@@ -51,12 +51,14 @@ def test_create_upclient_with_null_transport(self):
5151 UClient (None )
5252
5353 async def test_send_notification (self ):
54- status = await UClient (MockUTransport ()).notify (create_topic (), create_destination_uri (), None )
54+ status = await UClient (MockUTransport ()).notify (create_topic (), create_destination_uri ())
5555 self .assertEqual (status .code , UCode .OK )
5656
5757 async def test_send_notification_with_payload (self ):
5858 uri = UUri (authority_name = "neelam" )
59- status = await UClient (MockUTransport ()).notify (create_topic (), create_destination_uri (), UPayload .pack (uri ))
59+ status = await UClient (MockUTransport ()).notify (
60+ create_topic (), create_destination_uri (), payload = UPayload .pack (uri )
61+ )
6062 self .assertEqual (status .code , UCode .OK )
6163
6264 async def test_register_listener (self ):
@@ -85,19 +87,24 @@ async def test_unregister_listener_not_registered(self):
8587 self .assertEqual (status .code , UCode .INVALID_ARGUMENT )
8688
8789 async def test_send_publish (self ):
88- status = await UClient (MockUTransport ()).publish (create_topic (), None )
90+ status = await UClient (MockUTransport ()).publish (create_topic ())
8991 self .assertEqual (status .code , UCode .OK )
9092
9193 async def test_send_publish_with_stuffed_payload (self ):
9294 uri = UUri (authority_name = "neelam" )
93- status = await UClient (MockUTransport ()).publish (create_topic (), UPayload .pack_to_any (uri ))
95+ status = await UClient (MockUTransport ()).publish (create_topic (), payload = UPayload .pack_to_any (uri ))
96+ self .assertEqual (status .code , UCode .OK )
97+
98+ async def test_send_publish_with_stuffed_payload_and_calloptions (self ):
99+ uri = UUri (authority_name = "neelam" )
100+ status = await UClient (MockUTransport ()).publish (
101+ create_topic (), CallOptions (token = "134" ), payload = UPayload .pack_to_any (uri )
102+ )
94103 self .assertEqual (status .code , UCode .OK )
95104
96105 async def test_invoke_method_with_payload (self ):
97106 payload = UPayload .pack_to_any (UUri ())
98- future_result = asyncio .ensure_future (
99- UClient (MockUTransport ()).invoke_method (create_method_uri (), payload , None )
100- )
107+ future_result = asyncio .ensure_future (UClient (MockUTransport ()).invoke_method (create_method_uri (), payload ))
101108 response = await future_result
102109 self .assertIsNotNone (response )
103110 self .assertFalse (future_result .exception ())
@@ -132,10 +139,10 @@ async def test_invoke_method_with_multi_invoke_transport(self):
132139 rpc_client = UClient (MockUTransport ())
133140 payload = UPayload .pack_to_any (UUri ())
134141
135- future_result1 = asyncio .ensure_future (rpc_client .invoke_method (create_method_uri (), payload , None ))
142+ future_result1 = asyncio .ensure_future (rpc_client .invoke_method (create_method_uri (), payload ))
136143 response = await future_result1
137144 self .assertIsNotNone (response )
138- future_result2 = asyncio .ensure_future (rpc_client .invoke_method (create_method_uri (), payload , None ))
145+ future_result2 = asyncio .ensure_future (rpc_client .invoke_method (create_method_uri (), payload ))
139146 response2 = await future_result2
140147
141148 self .assertIsNotNone (response2 )
@@ -195,7 +202,7 @@ async def test_request_handler_for_notification(self):
195202 handler = create_autospec (RequestHandler , instance = True )
196203
197204 await client .register_request_handler (create_method_uri (), handler )
198- self .assertEqual (await client .notify (create_topic (), transport .get_source (), None ), UStatus (code = UCode .OK ))
205+ self .assertEqual (await client .notify (create_topic (), transport .get_source ()), UStatus (code = UCode .OK ))
199206
200207
201208def create_topic ():
0 commit comments