advent-of-code/2017-python/tests/day_13_tests.py

31 lines
584 B
Python
Raw Normal View History

2021-11-01 16:40:46 +01:00
import unittest
from solutions.day_13 import Solution
class Day13TestCase(unittest.TestCase):
def setUp(self):
self.solution = Solution()
def test_get_through_firewall(self):
2025-05-06 20:14:58 +02:00
puzzle_input = """
2021-11-01 16:40:46 +01:00
0: 3
1: 2
4: 4
6: 4
2025-05-06 20:14:58 +02:00
""".strip()
2021-11-01 16:40:46 +01:00
assert self.solution.solve(puzzle_input) == 24
def test_wait(self):
2025-05-06 20:14:58 +02:00
puzzle_input = """
2021-11-01 16:40:46 +01:00
0: 3
1: 2
4: 4
6: 4
2025-05-06 20:14:58 +02:00
""".strip()
2021-11-01 16:40:46 +01:00
assert self.solution.solve_again(puzzle_input) == 10
2025-05-06 20:14:58 +02:00
if __name__ == "__main__":
2021-11-01 16:40:46 +01:00
unittest.main()