def test_get_unit_at_position_returns_None_if_there_is_no_unit_near_the_given_point(self): # noqa tmap = TileMap(TileGrid(Size(10, 10))) serf = Peasant() tmap.place_unit(serf, Point(100, 100)) self.assertIsNone(tmap.get_unit_at_position(Point(50, 50)))
def test_get_unit_at_position_finds_a_unit_near_to_the_given_point(self): tmap = TileMap(TileGrid(Size(10, 10))) serf = Peasant() tmap.place_unit(serf, Point(100, 100)) self.assertIs(serf, tmap.get_unit_at_position(Point(95, 95)))