Exemplo n.º 1
0
    def test_human_move(self):
        s1 = Station(1)
        s2 = Station(2)
        h = Human(1, s1)

        s1.add_connection(s2)
        self.assertEqual(h.state, s1)
        self.assertEqual(h.memory, [s1])
        h.action()
        self.assertEqual(h.state, s2)
        self.assertEqual(h.memory, [s1, s2])
Exemplo n.º 2
0
    def test_human_stuck(self):
        s = Station(1)
        h = Human(1, s)

        with self.assertRaises(StuckException):
            h.action()