def test_clear(self): block = Block(0, 0, Color.RED) self.assertEqual(block.color, Color.RED) self.assertFalse(block.is_clear()) block.clear() self.assertEqual(block.color, Color.CLEAR) self.assertTrue(block.is_clear())
def test_raise_exception_on_clear_if_no_color(self): block = Block(0, 0) with self.assertRaises(InvalidOperation): block.clear()