def test_set_falling(self): block = Block(0, 0) self.assertFalse(block.is_falling()) block.set_falling(True) self.assertTrue(block.is_falling()) block.set_falling(False) self.assertFalse(block.is_falling())
def test_set_falling_raises_exception_on_double_set(self): block = Block(0, 0) with self.assertRaises(InvalidOperation): block.set_falling(False) block.set_falling(True) with self.assertRaises(InvalidOperation): block.set_falling(True)