def testParsetwoInputAtBeginning(self): data = ["A)B", "C)A"] linkedList = puzzle.parse(data) self.assertEqual(1, len(linkedList.heads)) self.assertEqual("C", linkedList.heads[0].data) self.assertEqual("A", linkedList.heads[0].children[0].data) self.assertEqual( "B", linkedList.heads[0].children[0].children[0].data)
def testSolveOneInput(self): data = ["A)B"] for line in data: print("####") print(line) input = puzzle.parse(data) answer = puzzle.solve(input) self.assertEqual(1, answer)
def testParsetwoInputTwoHead(self): data = ["A)B", "C)D"] linkedList = puzzle.parse(data) self.assertEqual(2, len(linkedList.heads)) self.assertEqual("A", linkedList.heads[0].data) self.assertEqual("B", linkedList.heads[0].children[0].data) self.assertEqual("C", linkedList.heads[1].data) self.assertEqual("D", linkedList.heads[1].children[0].data)
def test_solver_b(self): self.assertEqual(solver_b(parse(testString)), 6)
def test_solver_a(self): self.assertEqual(solver_a(parse(testString)), 11)
def test_pass(self): data = puzzle.parse(read_file("06", "1")) result = puzzle.solve(data) print(f"Solution: {result}") self.assertEqual(True, True)
def testParseOneInput(self): data = ["A)B"] linkedList = puzzle.parse(data) self.assertEqual("A", linkedList.heads[0].data) self.assertEqual("B", linkedList.heads[0].children[0].data)