From 4d8a2dc2672b6ad7dc0acb24d7a2554220da44cf Mon Sep 17 00:00:00 2001 From: wangqi Date: Wed, 18 Aug 2021 15:59:48 +0800 Subject: modifying agl-service-nfc tests for un/subscription. Bug-AGL: SPEC-4054 Signed-off-by: wangqi Change-Id: I65633edb07cc55a32e29c701a20db2db69155f99 --- pyagl/services/nfc.py | 4 ++-- 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' -- cgit 1.2.3-korg