예제 #1
0
 def test_set_neighbor_with_out_of_bounds(self, mock):
     t1, t2 = Tile(), OutOfBounds
     t1.set_neighbor(t2, Direction.NORTH)
     self.assertIs(t1.north, OutOfBounds)
     mock.assert_not_called()
예제 #2
0
 def test_set_neighbor_with_none(self, mock):
     t1, t2 = Tile(), None
     t1.set_neighbor(t2, Direction.NORTH)
     self.assertIsNone(t1.north)
     mock.assert_not_called()
예제 #3
0
 def test_set_neighbor_with_two_tiles(self, mock):
     t1, t2 = Tile(), Tile()
     t1.set_neighbor(t2, Direction.NORTH)
     self.assertIs(t1.north, t2)
     self.assertIs(t2.south, t1)
     mock.assert_called_with(Direction.NORTH)