summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdi Feschiyan <edi.feschiyan@konsulko.com>2020-09-14 17:52:33 +0300
committerScott Murray <scott.murray@konsulko.com>2020-10-01 19:47:10 -0400
commitb8fd8f450d45275b6adfc5a34bf9d3546a2a8515 (patch)
tree0423c6486de9c6815c3921806c2c264a065a9072
parent491bfa79a9e2d7c6b7637b8994a836760e454248 (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: I125d23e5adc975b05606a886132e1faa18889cb1
-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'
+
+