def test_get_y_off_map(self): map = WorldMap(self._generate_grid()) for x in (0, 1): with self.assertRaises(ValueError): map.get_cell(Location(x, -1)) with self.assertRaises(ValueError): map.get_cell(Location(x, 2))
def test_get_x_off_map(self): map = WorldMap(self._generate_grid()) for y in (0, 1): with self.assertRaises(ValueError): map.get_cell(Location(-1, y)) with self.assertRaises(ValueError): map.get_cell(Location(2, y))
def test_get_valid_cell(self): world_map = WorldMap(self._generate_grid(), self.settings) for x in (0, 1): for y in (0, 1): location = Location(x, y) self.assertEqual( world_map.get_cell(location).location, location)
def test_get_valid_cell(self): map = WorldMap(self._generate_grid()) for x in (0, 1): for y in (0, 1): location = Location(x, y) self.assertEqual(map.get_cell(location).location, location)
def test_get_valid_cell(self): map = WorldMap(self._generate_cells()) for x in (0, 1): for y in (0, 1): location = Location(x, y) self.assertEqual(map.get_cell(location).location, location)
def test_artefact_cell(self): cells = self._generate_cells() cells[0]["interactable"] = {"type": "artefact"} map = WorldMap(cells) self.assertEqual(map.get_cell(Location(-1, -1)).has_artefact(), True)