예제 #1
0
 def test_peek_limit(self):
     self.begin_for_testing()
     down(90)
     forward(300)
     self.assertEqual(None, peek())
     up(180)
     forward(700)
예제 #2
0
    def test_peek(self):
        self.begin_for_testing()
        block_result = peek()
        self.assertEqual(block_result, block.PISTON)
        self.assertEqual(block.PISTON, block_result.definition)

        self.assertTrue(block_result == block.PISTON)
        self.assertFalse(block_result == block.OBSIDIAN)

        self.assertTrue(block.PISTON == block_result.definition)
        self.assertFalse(block.OBSIDIAN == block_result.definition)

        self.assertFalse(block_result != block.PISTON)
        self.assertTrue(block_result != block.OBSIDIAN)

        self.assertFalse(block.PISTON != block_result.definition)
        self.assertTrue(block.OBSIDIAN != block_result.definition)

        self.assertEqual(
            [block.PISTON.EXTENDED_FALSE, block.PISTON.FACING_WEST],
            block_result.properties)