def test_multiple_motions(self): bot = Robot(world=self.world) self.assertEqual(self.world, bot.move(self.world, [[1, 0], [0, 1], [-1, 0], [0, -1]]))
def test_move_up_left(self): bot = Robot(world=self.world) self.assertEqual([[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 1]], bot.move(self.world, [-1, -1]))
def test_move_down_right(self): bot = Robot(world=self.world) self.assertEqual([[0, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 0, 0, 0, 0]], bot.move(self.world, [1, 1]))
def test_stand_still(self): bot = Robot(world=self.world) self.assertEqual([[1, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]], bot.move(self.world, [0, 0]))
def test_move_up(self): bot = Robot(world=self.world) self.assertEqual([[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [1, 0, 0, 0, 0]], bot.move(self.world, [-1, 0]))
def test_multiple_motions(self): bot = Robot(world=self.world) self.assertEqual( self.world, bot.move(self.world, [[1, 0], [0, 1], [-1, 0], [0, -1]]))