From 52e612d8985328692a605f54bfcc022731bf111d Mon Sep 17 00:00:00 2001 From: lorow Date: Sat, 8 Apr 2023 21:12:50 +0200 Subject: [PATCH] add test for restarting camera --- PythonTools/tests/test_client.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/PythonTools/tests/test_client.py b/PythonTools/tests/test_client.py index 09edb05..27b38a6 100644 --- a/PythonTools/tests/test_client.py +++ b/PythonTools/tests/test_client.py @@ -173,3 +173,27 @@ async def test_restart_camera(device_url, payload, response): m.assert_called_once() assert await result.json() == response + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "payload", + [ + { + "msg": "rebooting device" + } + ], +) +async def test_restart_camera(device_url, payload): + with aioresponses() as m: + m.get( + rf"{device_url}/control/builtin/command/rebootDevice/", + status=200, + payload=payload, + ) + + async with OpenIrisClient(device_url) as openiris_client: + result = await openiris_client.reboot_device() + + m.assert_called_once() + assert await result.json() == payload \ No newline at end of file