From 9dd59f43f54455cde3168643802c57ad41429608 Mon Sep 17 00:00:00 2001 From: Edi Feschiyan Date: Mon, 14 Sep 2020 17:52:33 +0300 Subject: Fix signalcomposer test Add a test to test all available signals reported by list verb Bug-AGL: SPEC-3585 Signed-off-by: Edi Feschiyan Change-Id: I73f4cb75ef24b38948756b2c81bc4e3552d7eb3c --- pyagl/tests/test_signal_composer.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pyagl/tests/test_signal_composer.py b/pyagl/tests/test_signal_composer.py index 0609072..5a96b45 100644 --- a/pyagl/tests/test_signal_composer.py +++ b/pyagl/tests/test_signal_composer.py @@ -41,6 +41,7 @@ async def service(): @pytest.mark.regular +@pytest.mark.dependency async def test_list(event_loop, service: scs): msgid = await service.list() resp = await service.afbresponse() @@ -53,6 +54,16 @@ async def test_getNoFilter(event_loop, service: scs): resp = await service.afbresponse() assert resp.status == 'success' +@pytest.mark.regular +@pytest.mark.dependency(depends=['test_list']) +async def test_getAllSignals(event_loop, service: scs): + msgid = await service.list() + resp = await service.afbresponse() + signals = [s['uid'] for s in resp.data] + for s in signals: + msgid = await service.get({'signal':s}) + resp = await service.afbresponse() + assert resp.status == 'success', f'get() with signal {s} failed, info: {resp.info}' # while rewriting the old lua tests this one tries to 'get' 'odometer' signal but its not currently present # @pytest.mark.regular @@ -79,12 +90,15 @@ async def test_getFilterMax(event_loop, service: scs): @pytest.mark.regular async def test_subscribe(event_loop, service: scs): - msgid = await service.subscribe({'signal': 'longitude'}) + msgid = await service.subscribe({'service': 'longitude'}) resp = await service.afbresponse() assert resp.status == 'success' + @pytest.mark.regular async def test_unsubscribe(event_loop, service: scs): msgid = await service.unsubscribe({'service': 'longitude'}) resp = await service.afbresponse() assert resp.status == 'success' + + -- cgit 1.2.3-korg