@@ -736,3 +736,39 @@ async def test_update_item(aio_client: Client):
736
736
assert actual_json is not None
737
737
actual_attributes = actual_json .get ('attributes' )
738
738
verify_attributes (attributes , actual_attributes )
739
+
740
+
741
+ @pytest .mark .skipif (sys .version_info < (3 , 8 ),
742
+ reason = 'the test requires AsyncMock which was introduced in Python 3.8' )
743
+ @pytest .mark .asyncio
744
+ async def test_get_item_id_by_uuid (aio_client : Client ):
745
+ # noinspection PyTypeChecker
746
+ session : mock .AsyncMock = await aio_client .session ()
747
+ mock_basic_get_response (session )
748
+
749
+ item_id = 'test_item_uuid'
750
+ expected_uri = f'/api/v1/project/item/uuid/{ item_id } '
751
+
752
+ result = await aio_client .get_item_id_by_uuid (item_id )
753
+ assert result == GET_RESPONSE_ID
754
+ session .get .assert_called_once ()
755
+ call_args = session .get .call_args_list [0 ]
756
+ assert expected_uri == call_args [0 ][0 ]
757
+
758
+
759
+ @pytest .mark .skipif (sys .version_info < (3 , 8 ),
760
+ reason = 'the test requires AsyncMock which was introduced in Python 3.8' )
761
+ @pytest .mark .asyncio
762
+ async def test_get_launch_ui_url (aio_client : Client ):
763
+ # noinspection PyTypeChecker
764
+ session : mock .AsyncMock = await aio_client .session ()
765
+ mock_basic_get_response (session )
766
+
767
+ launch_id = 'test_launch_uuid'
768
+ expected_uri = f'/api/v1/project/launch/uuid/{ launch_id } '
769
+
770
+ result = await aio_client .get_launch_ui_url (launch_id )
771
+ assert result == f'http://endpoint/ui/#project/launches/all/{ GET_RESPONSE_ID } '
772
+ session .get .assert_called_once ()
773
+ call_args = session .get .call_args_list [0 ]
774
+ assert expected_uri == call_args [0 ][0 ]
0 commit comments