mirror of
https://github.com/gogcom/galaxy-integrations-python-api.git
synced 2026-02-25 02:58:47 -05:00
add authentication lost notification
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user