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

35 lines
768 B
Python
Raw Normal View History

2021-11-01 16:40:46 +01:00
import unittest
from solutions.day_19 import Solution
class Day19TestCase(unittest.TestCase):
def setUp(self):
self.solution = Solution()
def test_seen(self):
2025-05-06 20:14:58 +02:00
puzzle_input = """ |
2021-11-01 16:40:46 +01:00
| +--+
A | C
F---|----E|--+
| | | D
+B-+ +--+
2025-05-06 20:14:58 +02:00
"""
assert self.solution.solve(puzzle_input) == "ABCDEF"
2021-11-01 16:40:46 +01:00
def test_steps(self):
2025-05-06 20:14:58 +02:00
puzzle_input = """ |
2021-11-01 16:40:46 +01:00
| +--+
A | C
F---|----E|--+
| | | D
+B-+ +--+
2025-05-06 20:14:58 +02:00
"""
2021-11-01 16:40:46 +01:00
assert self.solution.solve_again(puzzle_input) == 38
2025-05-06 20:14:58 +02:00
if __name__ == "__main__":
2021-11-01 16:40:46 +01:00
unittest.main()