Ejemplo n.º 1
0
 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))
Ejemplo n.º 2
0
 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))
Ejemplo n.º 3
0
 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")
Ejemplo n.º 4
0
 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")
Ejemplo n.º 5
0
 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")
Ejemplo n.º 6
0
 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")
Ejemplo n.º 7
0
 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")