def test_entrance_of(self): res = 10, 3 cb = cities.CityBuilder() pos = [(9, 4), (11, 4), (11, 2), (9, 2)] for i in range(4): self.assertEqual( cb.entrance_of(*pos[i], i), res, "Direction of entrance not working: direction {}".format(i))
def test_exit_of_N(self): x, y = 10, 3 cb = cities.CityBuilder() res = [(9, 4), (11, 4), (11, 2), (9, 2)] for i in range(4): self.assertEqual( cb.exit_of(x, y, i), res[i], "Direction of cell not working: direction {}".format(i))
def test_north_of(self): x, y = 10, 3 cb = cities.CityBuilder() self.assertEqual(cb.north_of(x, y), (9, 3), "North of cell not working")
def test_next_cell_of(self): x, y = 10, 3 cb = cities.CityBuilder() self.assertEqual(cb.next_cell_of(x, y, 0, 2, 1, 3), (10, 3), "Direction of cell not working")
def test_west_of(self): x, y = 10, 3 cb = cities.CityBuilder() self.assertEqual(cb.west_of(x, y), (10, 2), "West of cell not working")
def test_east_of(self): x, y = 10, 3 cb = cities.CityBuilder() self.assertEqual(cb.east_of(x, y), (10, 4), "East of cell not working")
def test_south_of(self): x, y = 10, 3 cb = cities.CityBuilder() self.assertEqual(cb.south_of(x, y), (11, 3), "South of cell not working")