def test_floor_should_never_switch(self): # GIVEN context = [Point(1, x, '.') for x in range(8)] p = Point(1, 2, Point.FLOOR) p.set_context(context) # WHEN status = p.new_status() # THEN self.assertEqual(status, Point.FLOOR)
def test_occupied_should_not_switch_to_empty(self): # GIVEN context = [Point(1, 1, x) for x in three_occupied_context] p = Point(1, 2, Point.OCCUPIED) p.set_context(context) # WHEN status = p.new_status() # THEN self.assertEqual(status, Point.OCCUPIED)
def test_get_status(self): # GIVEN context = [Point(1, x, '.') for x in range(8)] expected_status = Point.EMPTY p = Point(1, 2, expected_status) p.set_context(context) # WHEN status = p.get_status() # THEN self.assertEqual(status, expected_status)