-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
34 lines (27 loc) · 978 Bytes
/
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
26
27
28
29
30
31
32
33
34
"""
Some tests to run
"""
from random import randint
from jerocat import Jerocat
if __name__ == '__main__':
print("inici")
j = Jerocat()
# creem usuari
u1 = j.user_add(id=0, username="jerocatbot")
# creem jocs
for ng in range(10):
g = j.game_add(name="g"+str(ng), user=u1, status=j.STATUS_PUBLIC)
for nq in range(randint(10, 40)):
q = j.question_add(game=g, question=g.name+"_q"+str(nq))
for na in range(randint(1, 3)):
a = j.answer_add(question=q, answer=q.text+"_a"+str(na))
gs = j.game_list()
for n in range(40, randint(40, 100)):
g = j.game_get(randint(1, len(gs)))
for n in range(randint(10, 20)):
# intentem una respostes
for a in range(4*len(g.questions)):
j.answer_check(g, 1, a)
# for q in g.questions:
# print(str(q.id)+" "+q.text +
# " [" + ', '.join([str(a.text) for a in q.answers])+"]")