-
Notifications
You must be signed in to change notification settings - Fork 1
/
test1.py
42 lines (31 loc) · 928 Bytes
/
test1.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
35
36
37
38
39
40
41
42
from backend import Backend
from model import Model
testcount = 0
testpass = 0
testfailed = []
b = Backend()
# print(b.query(366734715392360448, 10))
print(b.addOrUpdateShow(366734715392360448, "Kimi no Na wa.", 1))
print(b.addOrUpdateShow(366734715392360448, "Initial D Fourth Stage", 1))
def testAnimeMap(name: str):
global testcount, testpass, testfailed
testcount += 1
if (name == b._getNameFromId(b._getIdFromName(name))):
testpass += 1
else:
testfailed += ["Anime Map - " + name]
testAnimeMap('Naruto')
testAnimeMap('Dragon Ball')
m = Model()
def testRatingMap(id: int):
global testcount, testpass, testfailed
testcount += 1
if (id == m._dataToModel(m._modelToData(id))):
testpass += 1
else:
testfailed += ["Rating Map - " + str(id)]
testRatingMap(10)
testRatingMap(20)
print('{} / {} tests passed'.format(testpass, testcount))
if len(testfailed):
print(*testfailed, sep='\n')