-
Notifications
You must be signed in to change notification settings - Fork 0
/
Day10-Unittest.py
35 lines (27 loc) · 999 Bytes
/
Day10-Unittest.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
from Day10 import *
from unittest import TestSuite, makeSuite, TextTestRunner, TestCase
class Day10UnitTests(TestCase):
def setUp(self):
self._sut = AdventDayTen(10)
def test_transforms_strings_properly(self):
input_strings = {
'11': '21',
'12': '1112',
'111222': '3132',
'6644222': '262432'
}
for input_string, output_string in input_strings.items():
result = AdventDayTen.transform_string(input_string)
self.assertEqual(output_string, result)
def test_anser_part1(self):
input_strings = {
'11': '111221',
'12': '132112'
}
for input_string, output_string in input_strings.items():
result = AdventDayTen.run_transforms(input_string, 3)
self.assertEqual(output_string, result)
testSuite = TestSuite()
testSuite.addTest(makeSuite(Day10UnitTests))
runner = TextTestRunner(verbosity=2)
runner.run(testSuite)