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_init(self): block = Block(1, 2) self.assertEqual(block.color, Color.CLEAR) self.assertEqual(block.x, 1) self.assertEqual(block.y, 2) self.assertTrue(block.is_clear()) block = Block(0, 0, Color.RED) self.assertEqual(block.color, Color.RED) self.assertFalse(block.is_clear())