Add achievements_import_complete and game_times_import_complete

This commit is contained in:
Romuald Bierbasz
2019-08-02 15:11:05 +02:00
parent e33dd09a8d
commit f5b9adfbd5
4 changed files with 18 additions and 0 deletions

View File

@@ -37,6 +37,7 @@ def plugin(reader, writer):
"get_owned_games",
"prepare_achievements_context",
"get_unlocked_achievements",
"achievements_import_complete",
"get_local_games",
"launch_game",
"install_game",
@@ -44,6 +45,7 @@ def plugin(reader, writer):
"get_friends",
"get_game_time",
"prepare_game_times_context",
"game_times_import_complete",
"shutdown_platform_client",
"shutdown",
"tick"

View File

@@ -40,6 +40,7 @@ async def test_get_unlocked_achievements_success(plugin, read, write):
await plugin.run()
plugin.prepare_achievements_context.assert_called_with(["14"])
plugin.get_unlocked_achievements.assert_called_with("14", 5)
plugin.achievements_import_complete.asert_called_with()
assert get_messages(write) == [
{
@@ -97,6 +98,7 @@ async def test_get_unlocked_achievements_error(exception, code, message, plugin,
plugin.get_unlocked_achievements.side_effect = exception
await plugin.run()
plugin.get_unlocked_achievements.assert_called()
plugin.achievements_import_complete.asert_called_with()
assert get_messages(write) == [
{

View File

@@ -31,6 +31,7 @@ async def test_get_game_time_success(plugin, read, write):
call("5", "abc"),
call("7", "abc"),
])
plugin.game_times_import_complete.assert_called_once_with()
assert get_messages(write) == [
{
@@ -96,6 +97,7 @@ async def test_get_game_time_error(exception, code, message, plugin, read, write
plugin.get_game_time.side_effect = exception
await plugin.run()
plugin.get_game_time.assert_called()
plugin.game_times_import_complete.assert_called_once_with()
assert get_messages(write) == [
{