Esempio n. 1
0
    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())
Esempio n. 2
0
    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())
Esempio n. 3
0
    def test_raise_exception_on_clear_if_no_color(self):
        block = Block(0, 0)

        with self.assertRaises(InvalidOperation):
            block.clear()
Esempio n. 4
0
    def test_raise_exception_on_clear_if_no_color(self):
        block = Block(0, 0)

        with self.assertRaises(InvalidOperation):
            block.clear()