-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_day2.py
More file actions
24 lines (21 loc) · 740 Bytes
/
test_day2.py
File metadata and controls
24 lines (21 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import unittest
from src.day2 import main_a, main_b
class Day1Test(unittest.TestCase):
def test_main_a(self):
test_cases = [
("inputs_2024/day_2_small.txt", 2),
("inputs_2024/day_2_large.txt", 236)
]
for filepath, expected_result in test_cases:
result = main_a(filepath)
self.assertEqual(result, expected_result)
def test_main_b(self):
test_cases = [
("inputs_2024/day_2_small.txt", 4),
("inputs_2024/day_2_large.txt", 308)
]
for filepath, expected_result in test_cases:
result = main_b(filepath)
self.assertEqual(result, expected_result)
if __name__ == "__main__":
unittest.main()