2023/day9/test.py
Fedaya f641fbac07 Day 9 Completed
put example_input.txt back in repos, for unittest purposes
2023-12-09 09:35:56 +01:00

18 lines
547 B
Python

import unittest
from common import OASISLine
class Day9Tests(unittest.TestCase):
def test_part1(self):
analysis = OASISLine.parse("example_input.txt")
extrapolation = map(lambda o: o.reduce().extrapolate(), analysis)
self.assertEqual(sum(extrapolation), 114)
def test_part2(self):
analysis = OASISLine.parse("example_input.txt")
extrapolation = map(lambda o: o.reduce().extrapolate_back(), analysis)
self.assertEqual(sum(extrapolation), 2)
if __name__ == "__main__":
unittest.main()