def test_line(*mocks): res = Rcon.parse_logs( '[54.7 sec (1607457183)] KILL: BlAkStE(Allies/76561198202095713) -> Spaghetti with too m(Axis/76561198372886209) with Thompson' ) print(res["logs"]) assert len(res["logs"]) == 1 assert res["logs"][0]["player2"] == "Spaghetti with too m"
def test_chat(*mocks): res = Rcon.parse_logs( "[16:56 min (1606998360)] CHAT[Team][Zuiho(Allies/76561198088159692)]: thx" ) assert res["logs"][0]["player"] == "Zuiho" assert res["logs"][0]["sub_content"] == "thx" assert res["logs"][0]["steam_id_64_1"] == "76561198088159692" assert res["logs"][0]["action"] == "CHAT[Allies][Team]" assert res["logs"][0]["timestamp_ms"] == 1606998360000
def test_vote(*mocks): res = Rcon.parse_logs( "[13:19 min (1606998577)] VOTE Player [nsancho] voted [PV_Favour] for VoteID[2]" ) assert res["logs"][0]["player"] == "nsancho" assert res["logs"][0]["player2"] == None # assert res['logs'][0]['sub_content'] == 'thx' assert res["logs"][0]["steam_id_64_1"] == None assert res["logs"][0]["steam_id_64_2"] == None assert res["logs"][0]["action"] == "VOTE" res = Rcon.parse_logs( "[2:34:52 hours (1607023963)] VOTE Player [DarKskiN] voted [PV_Against] for VoteID[2]" ) assert res["logs"][0]["player"] == "DarKskiN" assert res["logs"][0]["player2"] == None # assert res['logs'][0]['sub_content'] == 'thx' assert res["logs"][0]["steam_id_64_1"] == None assert res["logs"][0]["steam_id_64_2"] == None assert res["logs"][0]["action"] == "VOTE"
def test_vote_completed(*mocks): res = Rcon.parse_logs( "[5:11 min (1606999065)] VOTE Vote [3] completed. Result: PVR_Passed") assert res["logs"][0]["player"] == None assert res["logs"][0]["player2"] == None # assert res['logs'][0]['sub_content'] == 'thx' assert res["logs"][0]["steam_id_64_1"] == None assert res["logs"][0]["steam_id_64_2"] == None assert res["logs"][0]["action"] == "VOTE COMPLETED" res = Rcon.parse_logs( "[5:11 min (1606999065)] VOTE Vote Kick {Jesse Pingman} successfully passed. [For: 2/0 - Against: 0]" ) assert res["logs"][0]["player"] == "Jesse Pingman" assert res["logs"][0]["player2"] == None # assert res['logs'][0]['sub_content'] == 'thx' assert res["logs"][0]["steam_id_64_1"] == None assert res["logs"][0]["steam_id_64_2"] == None assert res["logs"][0]["action"] == "VOTE COMPLETED"
def test_vote_started(*mocks): res = Rcon.parse_logs( "[15:49 min (1606998428)] VOTE Player [[fr]ELsass_blitz] Started a vote of type (PVR_Kick_Abuse) against [拢儿]. VoteID: [1]" ) assert res["logs"][0]["player"] == "[fr]ELsass_blitz" assert res["logs"][0]["player2"] == "拢儿" # assert res['logs'][0]['sub_content'] == 'thx' assert res["logs"][0]["steam_id_64_1"] == None assert res["logs"][0]["steam_id_64_2"] == None assert res["logs"][0]["action"] == "VOTE STARTED" assert res["logs"][0]["timestamp_ms"] == 1606998428000
def test_admin_cam_log(*mocks): res = Rcon.parse_logs( """[15:49 min (1606998428)] Player [bananacocoo (76561198003251789)] Entered Admin Camera""" ) assert res["logs"][0]["action"] == "CAMERA" assert res["logs"][0]["timestamp_ms"] == 1606998428000 assert res["logs"][0]["player"] == "bananacocoo" assert res["logs"][0]["player2"] == None # assert res['logs'][0]['sub_content'] == 'thx' assert res["logs"][0]["steam_id_64_1"] == "76561198003251789" assert res["logs"][0]["steam_id_64_2"] == None