-
Notifications
You must be signed in to change notification settings - Fork 1
/
skill_test.py
25 lines (23 loc) · 1.16 KB
/
skill_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# not testing the command, but rather running the judge over multiple
# game logs (likely already cached) to make sure that it doesn't crash
# and output things like "KeyError(15)" to the Discord users.
from unit_test_imports import links
import asyncio
from ext.InjusticeJudge.utilities import analyze_game
async def test_injustice():
# this took me so long to debug... I tried to make my own AccountManager, while
# `utilities.py` was using the one from `global_stuff`... UGH.
# uncomment the two lines below if the games are not cached yet
from global_stuff import account_manager, load_mjs_account_manager
await load_mjs_account_manager()
print("===============================")
for reason, link in links.items():
print("reason: ", reason, "\n-----------")
try:
for injustice in (await analyze_game(link, specified_players={0,1,2,3}, look_for={"skill"}))[0]:
print(injustice)
except:
for injustice in (await analyze_game(link, specified_players={0,1,2}, look_for={"skill"}))[0]:
print(injustice)
print("===============================")
asyncio.run(test_injustice())