Skip to content

Commit 5f012ab

Browse files
Adding subscribe test
1 parent 064ef4e commit 5f012ab

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/functional/event_handler/required_dependencies/appsync/test_appsync_events_resolvers.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,6 +1517,7 @@ def test_subscribe_event_with_error_handling(lambda_context, mock_event):
15171517
"""Test error handling during publish event processing."""
15181518
# GIVEN a sample publish event
15191519
mock_event["info"]["operation"] = "SUBSCRIBE"
1520+
mock_event["info"]["channel"]["path"] = "/default/powertools"
15201521
del mock_event["events"] # SUBSCRIBE events are not supported
15211522

15221523
# GIVEN an AppSyncEventsResolver with a resolver that raises an exception
@@ -1537,12 +1538,12 @@ def test_subscribe_event_with_valid_return(lambda_context, mock_event):
15371538
"""Test error handling during publish event processing."""
15381539
# GIVEN a sample publish event
15391540
mock_event["info"]["operation"] = "SUBSCRIBE"
1540-
del mock_event["events"] # SUBSCRIBE events are not supported
1541+
mock_event["info"]["channel"]["path"] = "/default/powertools"
15411542

15421543
# GIVEN an AppSyncEventsResolver with a resolver that returns ok
15431544
app = AppSyncEventsResolver()
15441545

1545-
@app.on_publish(path="/default/*")
1546+
@app.on_subscribe(path="/default/*")
15461547
def test_handler():
15471548
return 1
15481549

@@ -1556,7 +1557,7 @@ def test_subscribe_event_with_no_resolver(lambda_context, mock_event):
15561557
"""Test error handling during publish event processing."""
15571558
# GIVEN a sample publish event
15581559
mock_event["info"]["operation"] = "SUBSCRIBE"
1559-
del mock_event["events"] # SUBSCRIBE events are not supported
1560+
mock_event["info"]["channel"]["path"] = "/default/powertools"
15601561

15611562
# GIVEN an AppSyncEventsResolver with a resolver that returns ok
15621563
app = AppSyncEventsResolver()

0 commit comments

Comments
 (0)