add authentication lost notification

This commit is contained in:
Rafal Makagon
2019-02-13 10:40:08 +01:00
parent 4cec6c09b2
commit d78c08ae4b
2 changed files with 17 additions and 0 deletions

View File

@@ -242,6 +242,9 @@ class Plugin():
params = {"game_time" : game_time}
self._notification_client.notify("game_time_updated", params)
def lost_authentication(self):
self._notification_client.notify("authentication_lost", None)
# handlers
def tick(self):
"""This method is called periodicaly.

View File

@@ -84,3 +84,17 @@ def test_store_credentials(plugin, write):
"method": "store_credentials",
"params": credentials
}
def test_lost_authentication(plugin, readline, write):
async def couritine():
plugin.lost_authentication()
asyncio.run(couritine())
response = json.loads(write.call_args[0][0])
assert response == {
"jsonrpc": "2.0",
"method": "authentication_lost",
"params": None
}