diff options
author | wangqi <wangq.fnst@cn.fujitsu.com> | 2021-08-18 15:59:48 +0800 |
---|---|---|
committer | Jan-Simon Möller <jsmoeller@linuxfoundation.org> | 2021-11-03 15:11:21 +0100 |
commit | 4d8a2dc2672b6ad7dc0acb24d7a2554220da44cf (patch) | |
tree | f6098514be27d143ab6b4ee82d09d270c1f1dac2 | |
parent | ca09b3c315d4f103c0be27137e3e171c5f5d7d26 (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' |