#!/usr/bin/python import unittest import main class Examples(unittest.TestCase): def test_example1(self): lines = [ "e => H", "e => O", "H => HO", "H => OH", "O => HH", "", "HOH" ] self.assertEqual(main.solve_part1(lines), 4) self.assertEqual(main.solve_part2(lines), 3) def test_example2(self): lines = [ "e => H", "e => O", "H => HO", "H => OH", "O => HH", "", "HOHOHO" ] self.assertEqual(main.solve_part1(lines), 7) self.assertEqual(main.solve_part2(lines), 6) if __name__ == "__main__": unittest.main()