diff options
author | wangqi <wangq.fnst@cn.fujitsu.com> | 2021-08-18 15:59:48 +0800 |
---|---|---|
committer | Edi Feschiyan <edi.feschiyan@konsulko.com> | 2021-08-20 08:43:52 +0000 |
commit | 6ce6f03f6d2bee33e3f72b08f05f9e8b4ddd3f10 (patch) | |
tree | fbeea1c2968bcad673320e93a3f535513e671658 | |
parent | 8717445b8311afe7c6782d10aed2e292034aabb8 (diff) |
modifying agl-service-nfc tests for un/subscription.
Bug-AGL: SPEC-4054
Signed-off-by: wangqi <wangq.fnst@cn.fujitsu.com>
Change-Id: I65633edb07cc55a32e29c701a20db2db69155f99
-rw-r--r-- | pyagl/services/nfc.py | 4 | ||||
-rw-r--r-- | pyagl/tests/test_nfc.py | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/pyagl/services/nfc.py b/pyagl/services/nfc.py index b8a17a7..6d8f963 100644 --- a/pyagl/services/nfc.py +++ b/pyagl/services/nfc.py @@ -24,10 +24,10 @@ class NFCService(AGLBaseService): def __init__(self, ip, port=None, api='nfc'): super().__init__(ip=ip, port=port, api=api, service='agl-service-nfc') - async def subscribe(self, event='presence'): + async def subscribe(self, event=None): return await super().subscribe(event=event) - async def unsubscribe(self, event='presence'): + async def unsubscribe(self, event=None): return await super().unsubscribe(event=event) diff --git a/pyagl/tests/test_nfc.py b/pyagl/tests/test_nfc.py index 7d6d5af..609f0bc 100644 --- a/pyagl/tests/test_nfc.py +++ b/pyagl/tests/test_nfc.py @@ -40,13 +40,15 @@ async def service(): await svc.websocket.close() -async def subscribe(event_loop, service: nfcs): - msgid = service.subscribe() +async def test_subscribe(event_loop, service: nfcs): + msgid = await service.subscribe('presence') resp = await service.afbresponse() assert resp.msgid == msgid + assert resp.status == 'success' -async def unsubscribe(event_loop, service: nfcs): - msgid = service.unsubscribe() +async def test_unsubscribe(event_loop, service: nfcs): + msgid = await service.unsubscribe('presence') resp = await service.afbresponse() assert resp.msgid == msgid + assert resp.status == 'success' |