@@ -57,13 +57,50 @@ async def subscribe_happy_path_string(
5757 topic = uuid_str ()
5858 value = uuid_str ()
5959
60+ _ = await topic_client_async .publish (cache_name , topic_name = topic , value = value )
61+
6062 subscribe_response = await topic_client_async .subscribe (cache_name , topic_name = topic )
6163 assert isinstance (subscribe_response , TopicSubscribe .SubscriptionAsync )
6264
6365 item_task = subscribe_response .__anext__ ()
64- publish_response = await topic_client_async .publish (cache_name , topic_name = topic , value = value )
66+ item_response = await item_task
67+ assert isinstance (item_response , TopicSubscriptionItem .Text )
68+ assert item_response .value == value
6569
66- print (publish_response )
70+ async def subscribe_happy_path_string_resume_at_sequence (
71+ client : CacheClientAsync , topic_client_async : TopicClientAsync , cache_name : str
72+ ) -> None :
73+ topic = uuid_str ()
74+ value = uuid_str ()
75+
76+ _ = await topic_client_async .publish (cache_name , topic_name = topic , value = "foo" )
77+ _ = await topic_client_async .publish (cache_name , topic_name = topic , value = value )
78+ _ = await topic_client_async .publish (cache_name , topic_name = topic , value = "bar" )
79+
80+ subscribe_response = await topic_client_async .subscribe (
81+ cache_name , topic_name = topic , resume_at_topic_sequence_number = 2
82+ )
83+ assert isinstance (subscribe_response , TopicSubscribe .SubscriptionAsync )
84+
85+ item_task = subscribe_response .__anext__ ()
86+ item_response = await item_task
87+ assert isinstance (item_response , TopicSubscriptionItem .Text )
88+ assert item_response .value == value
89+
90+ async def subscribe_happy_path_string_resume_at_invalid_sequence (
91+ client : CacheClientAsync , topic_client_async : TopicClientAsync , cache_name : str
92+ ) -> None :
93+ topic = uuid_str ()
94+ value = uuid_str ()
95+
96+ _ = await topic_client_async .publish (cache_name , topic_name = topic , value = value )
97+
98+ subscribe_response = await topic_client_async .subscribe (
99+ cache_name , topic_name = topic , resume_at_topic_sequence_number = 300 , resume_at_topic_sequence_page = 5435435
100+ )
101+ assert isinstance (subscribe_response , TopicSubscribe .SubscriptionAsync )
102+
103+ item_task = subscribe_response .__anext__ ()
67104 item_response = await item_task
68105 assert isinstance (item_response , TopicSubscriptionItem .Text )
69106 assert item_response .value == value
0 commit comments