Example #1
0
    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())
Example #2
0
    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())
Example #3
0
    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)
Example #4
0
    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)