Skip to content

Commit 3476496

Browse files
committed
Add more tests
1 parent 6f268b1 commit 3476496

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/aio/test_async_client.py

+20
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,23 @@ async def test_launch_uuid_usage(launch_uuid, method, params):
151151
assert args[0] == actual_launch_uuid
152152
for i, param in enumerate(params):
153153
assert args[i + 1] == param
154+
155+
156+
@pytest.mark.skipif(sys.version_info < (3, 8),
157+
reason='the test requires AsyncMock which was introduced in Python 3.8')
158+
@pytest.mark.asyncio
159+
async def test_start_item_tracking(async_client: AsyncRPClient):
160+
aio_client = async_client.client
161+
162+
started_launch_uuid = 'new_test_launch_uuid'
163+
aio_client.start_launch.return_value = started_launch_uuid
164+
test_item_id = 'test_item_uuid'
165+
aio_client.start_test_item.return_value = test_item_id
166+
167+
await async_client.start_launch('Test Launch', timestamp())
168+
actual_item_id = await async_client.start_test_item('Test Item Name', timestamp(), 'STEP')
169+
assert actual_item_id == test_item_id
170+
assert async_client.current_item() == test_item_id
171+
172+
await async_client.finish_test_item(actual_item_id, timestamp())
173+
assert async_client.current_item() is None

0 commit comments

Comments
 (0)