-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.py
57 lines (51 loc) · 1.58 KB
/
tests.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import unittest
import time
from scoring import score
class ScoringTests(unittest.TestCase):
def setUp(self):
score(['BB', 'BB'], False)
score(['BB', 'BB'], True)
def test_yellowAnnoyance(self):
f = ['BBBGYGGBrrBGBG',
'BBGYBYYBrrGGGB',
'BGrrBYBBrrrrBG',
'BGrrGYrYrrrrBG',
'GGGYYBYBYGBBGG',
'YBGYBYBYrYYBGB',
'GBGrYGYYYGrrGG',
'BGGYGYYYGYrrGG',
'YBBYYrrYYrYBGG',
'BBBGBGBBYGBGYB']
s = time.monotonic()
scores = score(f, False)
print('annoyance', scores, time.monotonic() - s)
def test_yellowPain(self):
f = ['BBBGYGGBrrBGBG',
'BBGYBYYBrrGGGB',
'BGrrBYBBrrrrBG',
'BGrrGYYYrrrrBG',
'GGGYYBYBYGBBGG',
'YBGYBYBYYYYBGB',
'GBGrYGYYYGrrGG',
'BGGYGYYYGYrrGG',
'YBBYYrYYYrYBGG',
'BBBGBGBBYGBGYB']
s = time.monotonic()
scores = score(f, False)
print('pain', scores, time.monotonic() - s)
def test_yellowAgony(self):
f = ['BBBGYGGBrrBGBG',
'BBGYBYYBrrGGGB',
'BGrrBYBBrrrrBG',
'BGrrGYYYrrrrBG',
'GGGYYBYBYGBBGG',
'YBGYBYBYYYYBGB',
'GBGYYGYYYGrrGG',
'BGGYGYYYGYrrGG',
'YBBYYYYYYYYBGG',
'BBBGBGBBYGBGYB']
s = time.monotonic()
scores = score(f, False)
print('agony', scores, time.monotonic() - s)
if __name__ == '__main__':
unittest.main()