summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdi Feschiyan <edi.feschiyan@konsulko.com>2020-09-14 17:52:33 +0300
committerEdi Feschiyan <edi.feschiyan@konsulko.com>2020-09-17 14:22:44 +0300
commit9dd59f43f54455cde3168643802c57ad41429608 (patch)
tree721ad8cc890155c0adfc71dbcfaaa7aa89a6083e
parentc908ef00845fabdbad0b2bb4f56a4908458d84d8 (diff)
Fix signalcomposer test
Add a test to test all available signals reported by list verb Bug-AGL: SPEC-3585 Signed-off-by: Edi Feschiyan <edi.feschiyan@konsulko.com> Change-Id: I73f4cb75ef24b38948756b2c81bc4e3552d7eb3c
-rw-r--r--pyagl/tests/test_signal_composer.py16
1 files changed, 15 insertions, 1 deletions
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'
+
+