1212@pytest .mark .asyncio
1313async def test_get_user_presence_success (plugin , read , write ):
1414 context = "abc"
15- user_ids = ["666" , "13" , "42" , "69" ]
15+ user_ids = ["666" , "13" , "42" , "69" , "22" ]
1616 plugin .prepare_user_presence_context .return_value = async_return_value (context )
1717 request = {
1818 "jsonrpc" : "2.0" ,
@@ -26,25 +26,36 @@ async def test_get_user_presence_success(plugin, read, write):
2626 PresenceState .Unknown ,
2727 "game-id1" ,
2828 None ,
29- "unknown state"
29+ "unknown state" ,
30+ None
3031 )),
3132 async_return_value (UserPresence (
3233 PresenceState .Offline ,
3334 None ,
3435 None ,
35- "Going to grandma's house"
36+ "Going to grandma's house" ,
37+ None
3638 )),
3739 async_return_value (UserPresence (
3840 PresenceState .Online ,
3941 "game-id3" ,
4042 "game-title3" ,
41- "Pew pew"
43+ "Pew pew" ,
44+ None
4245 )),
4346 async_return_value (UserPresence (
4447 PresenceState .Away ,
4548 None ,
4649 "game-title4" ,
47- "AFKKTHXBY"
50+ "AFKKTHXBY" ,
51+ None
52+ )),
53+ async_return_value (UserPresence (
54+ PresenceState .Away ,
55+ None ,
56+ "game-title5" ,
57+ None ,
58+ "Playing game-title5: In Menu"
4859 )),
4960 ]
5061 await plugin .run ()
@@ -67,7 +78,7 @@ async def test_get_user_presence_success(plugin, read, write):
6778 "presence" : {
6879 "presence_state" : PresenceState .Unknown .value ,
6980 "game_id" : "game-id1" ,
70- "presence_status " : "unknown state"
81+ "in_game_status " : "unknown state"
7182 }
7283 }
7384 },
@@ -78,7 +89,7 @@ async def test_get_user_presence_success(plugin, read, write):
7889 "user_id" : "13" ,
7990 "presence" : {
8091 "presence_state" : PresenceState .Offline .value ,
81- "presence_status " : "Going to grandma's house"
92+ "in_game_status " : "Going to grandma's house"
8293 }
8394 }
8495 },
@@ -91,7 +102,7 @@ async def test_get_user_presence_success(plugin, read, write):
91102 "presence_state" : PresenceState .Online .value ,
92103 "game_id" : "game-id3" ,
93104 "game_title" : "game-title3" ,
94- "presence_status " : "Pew pew"
105+ "in_game_status " : "Pew pew"
95106 }
96107 }
97108 },
@@ -103,7 +114,19 @@ async def test_get_user_presence_success(plugin, read, write):
103114 "presence" : {
104115 "presence_state" : PresenceState .Away .value ,
105116 "game_title" : "game-title4" ,
106- "presence_status" : "AFKKTHXBY"
117+ "in_game_status" : "AFKKTHXBY"
118+ }
119+ }
120+ },
121+ {
122+ "jsonrpc" : "2.0" ,
123+ "method" : "user_presence_import_success" ,
124+ "params" : {
125+ "user_id" : "22" ,
126+ "presence" : {
127+ "presence_state" : PresenceState .Away .value ,
128+ "game_title" : "game-title5" ,
129+ "full_status" : "Playing game-title5: In Menu"
107130 }
108131 }
109132 },
@@ -246,7 +269,7 @@ async def test_update_user_presence(plugin, write):
246269 "presence_state" : PresenceState .Online .value ,
247270 "game_id" : "game-id" ,
248271 "game_title" : "game-title" ,
249- "presence_status " : "Pew pew"
272+ "in_game_status " : "Pew pew"
250273 }
251274 }
252275 }
0 commit comments