Exemplo n.º 1
0
 def test_two_overlapping_rooms(self):
     a, b = Room(width=2, height=2), Room(width=2, height=2)
     coordinates = [(0, 0, 1, 1), (2, 2, 1, 1), (0, 0, 0, 1)]
     for coordinate_set in coordinates:
         a.x, a.y, b.x, b.y = coordinate_set
         self.assertTrue(_rooms_overlap(a, b))
Exemplo n.º 2
0
 def test_one_room_within_another(self):
     a, b = Room(width=3, height=3), Room(width=1, height=1)
     a.x, a.y, b.x, b.y = 0, 0, 1, 1
     self.assertTrue(_rooms_overlap(a, b))
Exemplo n.º 3
0
 def test_two_non_overlapping_rooms(self):
     a, b = Room(width=1, height=1), Room(width=1, height=1)
     coordinates = [(0, 0, 1, 0), (2, 2, 5, 5), (0, 0, 1, 1)]
     for coordinate_set in coordinates:
         a.x, a.y, b.x, b.y = coordinate_set
         self.assertFalse(_rooms_overlap(a, b))