1414@pytest .mark .asyncio
1515async def test_logging_json (channels , guilds , accounts ):
1616 "Test if json logging works"
17- account = accounts [0 ]
17+ account : daf . ACCOUNT = accounts [0 ]
1818 dc_guild , _ = guilds
1919 text_channels , _ = channels
2020 try :
@@ -35,7 +35,7 @@ def check_json_results(message_context):
3535 .joinpath ("{:02d}" .format (timestruct .month ))
3636 .joinpath ("{:02d}" .format (timestruct .day )))
3737
38- logging_output .mkdir (parents = True ,exist_ok = True )
38+ logging_output .mkdir (parents = True , exist_ok = True )
3939 logging_output = logging_output .joinpath ("" .join (char if char not in C_FILE_NAME_FORBIDDEN_CHAR
4040 else "#" for char in guild_context ["name" ]) + ".json" )
4141 # Check results
@@ -44,14 +44,14 @@ def check_json_results(message_context):
4444 # Check guild data
4545 for k , v in guild_context .items ():
4646 assert result_json [k ] == v , "Resulting data does not match the guild_context"
47-
47+
4848 # Check message data
49- message_history = result_json ["message_history" ]
50- message_history = message_history [0 ] # Get only last send data
49+ str_acc = str (account .client .user .id )
50+ message_history = result_json ["authors" ][str_acc ]["messages" ]
51+ message_history = message_history [0 ] # Get only last send data
5152 message_history .pop ("index" )
5253 message_history .pop ("timestamp" )
53- assert message_history == message_context # Should be exact match
54-
54+ assert message_history == message_context # Should be exact match
5555
5656 data = [
5757 "Hello World" ,
0 commit comments