2023/day9/test.py
Fedaya cdaa539b79 Refinement in tests Output
I use logging.debug, now
2023-12-09 10:21:55 +01:00

22 lines
645 B
Python
Executable File

#!/usr/bin/env python3.11
import unittest
from common import OASISLine
import logging
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__":
logging.basicConfig(level=logging.DEBUG)
unittest.main(verbosity=2)