def test_move_east_out_from_land(self): probe = Probe(0,0,"E") land = Land(0,0) nasa = Nasa(land) self.assertWarns(UserWarning, nasa.move, probe, "M") movedProbe = nasa.move(probe, "M") self.assertEqual(movedProbe, probe)
def main(land, probe, movements): nasa = Nasa(land) for direction in movements: probe = nasa.move(probe, direction) return "{} {} {}".format(probe.x, probe.y, probe.direction)
def test_move_left_when_facing_north(self): probe = Probe(0,0,"N") land = Land(0,0) nasa = Nasa(land) self.assertEqual(nasa.move(probe, "L").direction, "W")
def test_move_right_when_facing_east(self): probe = Probe(0,0,"E") land = Land(0,0) nasa = Nasa(land) self.assertEqual(nasa.move(probe, "R").direction, "S")