Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
    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)
Пример #4
0
 def test_solver_b(self):
     self.assertEqual(solver_b(parse(testString)), 6)
Пример #5
0
 def test_solver_a(self):
     self.assertEqual(solver_a(parse(testString)), 11)
Пример #6
0
 def test_pass(self):
     data = puzzle.parse(read_file("06", "1"))
     result = puzzle.solve(data)
     print(f"Solution: {result}")
     self.assertEqual(True, True)
Пример #7
0
 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)