Пример #1
0
    def test_complexe_distance(self):
        com = Node("COM")
        b = Node("B", com)
        c = Node("C", b)
        g = Node("G", b)
        h = Node("H", g)

        self.assertEqual(h.distance(), 3)
Пример #2
0
    def test_no_distance(self):
        n = Node("test")

        self.assertEqual(n.distance(), 0)
Пример #3
0
    def test_simple_distance(self):
        com = Node("COM")
        b = Node("B", com)
        c = Node("C", b)

        self.assertEqual(c.distance(), 2)