-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests_score_image.py
75 lines (64 loc) · 3.32 KB
/
tests_score_image.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
__author__ = 'antonioirizar'
from unittest import TestCase
from score_image import score_image_with_commands
class TestControlCloudTrailActiveInAllRegions(TestCase):
def test_score_image_1(self):
image_original = [[True, True, True], [True, True, True], [True, True, True]]
list_commands = [(1, 1, 1, 1)]
equals, score = score_image_with_commands(image_original, list_commands)
self.assertTrue(equals)
self.assertEqual(score, 17)
def test_score_image_2(self):
image_original = [[True, True, True], [True, False, True], [True, True, True]]
list_commands = [(1, 1, 1, 1), (0, 1, 1)]
equals, score = score_image_with_commands(image_original, list_commands)
self.assertTrue(equals)
self.assertEqual(score, 16)
def test_score_image_3(self):
image_original = [[True, True, True], [True, False, True], [True, True, True]]
list_commands = [(1, 1, 1, 1)]
equals, score = score_image_with_commands(image_original, list_commands)
self.assertFalse(equals)
self.assertEqual(score, 15)
def test_score_image_4(self):
image_original = [[True, True, True], [True, False, True], [True, True, True]]
list_commands = [(2, 0, 0, 2, 0), (2, 0, 1, 2, 1), (2, 0, 2, 2, 2)]
equals, score = score_image_with_commands(image_original, list_commands)
self.assertFalse(equals)
self.assertEqual(score, 13)
def test_score_image_5(self):
image_original = [[True, True, True], [True, True, True], [True, True, True]]
list_commands = [(2, 0, 0, 2, 0), (2, 0, 1, 2, 1), (2, 0, 2, 2, 2)]
equals, score = score_image_with_commands(image_original, list_commands)
self.assertTrue(equals)
self.assertEqual(score, 15)
def test_score_image_6(self):
image_original = [[True, True, True], [True, True, True], [True, True, True]]
list_commands = [(2, 2, 0, 0, 0), (2, 0, 1, 2, 1), (2, 0, 2, 2, 2)]
equals, score = score_image_with_commands(image_original, list_commands)
self.assertTrue(equals)
self.assertEqual(score, 15)
def test_score_image_7(self):
image_original = [[True, True, True], [True, True, True], [True, True, True]]
list_commands = [(2, 0, 0, 0, 2), (2, 1, 0, 1, 2), (2, 2, 0, 2, 2)]
equals, score = score_image_with_commands(image_original, list_commands)
self.assertTrue(equals)
self.assertEqual(score, 15)
def test_score_image_8(self):
image_original = [[False, False, False], [True, False, False], [False, False, False]]
list_commands = [(2, 1, 0, 1, 0)]
equals, score = score_image_with_commands(image_original, list_commands)
self.assertTrue(equals)
self.assertEqual(score, 17)
def test_score_image_9(self):
image_original = [[False, False, False], [True, False, False], [False, False, False]]
list_commands = [(1, 1, 0, 0)]
equals, score = score_image_with_commands(image_original, list_commands)
self.assertTrue(equals)
self.assertEqual(score, 17)
def test_score_image_10(self):
image = [[False for __ in xrange(50)] for _ in xrange(80)]
list_commands = []
equals, score = score_image_with_commands(image, list_commands)
self.assertTrue(equals)
self.assertEqual(score, 8000)