diff options
-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' |