コード例 #1
0
class TestWorldWithSuccessfullyLoadedWorld(TestCase):

    def setUp(self):
        super(TestWorldWithSuccessfullyLoadedWorld, self).setUp()

        self.worldPath = os.path.join('worlds', 'mc2')
        self.world = World(self.worldPath)

    def testGetExistingBlock(self):
        self.assertEqual(getBlockByName('Bedrock').id, self.world.getBlock(0, 0, 0))
        self.assertEqual(getBlockByName('Stone').id, self.world.getBlock(-1, 10, -1))

    def testExtents(self):
        self.assertEqual(((-2 * 32 * 16, 0, -1 * 32 * 16), ((1 + 1) * 32 * 16, 128, (2 + 1) * 32 * 16)), self.world.extents)
コード例 #2
0
class TestWorldWithSuccessfullyLoadedWorld(TestCase):
    def setUp(self):
        super(TestWorldWithSuccessfullyLoadedWorld, self).setUp()

        self.worldPath = os.path.join("worlds", "mc2")
        self.world = World(self.worldPath)

    def testGetExistingBlock(self):
        self.assertEqual(getBlockByName("Bedrock").id, self.world.getBlock(0, 0, 0))
        self.assertEqual(getBlockByName("Stone").id, self.world.getBlock(-1, 10, -1))

    def testExtents(self):
        self.assertEqual(
            ((-2 * 32 * 16, 0, -1 * 32 * 16), ((1 + 1) * 32 * 16, 128, (2 + 1) * 32 * 16)), self.world.extents
        )
コード例 #3
0
    def test(self):
        return  # currently disabled to save battery

        worldPath = os.path.join('worlds', 'mc2')
        world = World(worldPath)

        for i in range(1024):
            povPath = 'objects_%s.pov' % i

            if os.path.exists(povPath):
                continue

            with open(povPath, 'w') as f:
                render(f, world)

            break
コード例 #4
0
    def setUp(self):
        super(TestWorldWithSuccessfullyLoadedWorld, self).setUp()

        self.worldPath = os.path.join("worlds", "mc2")
        self.world = World(self.worldPath)
コード例 #5
0
    def setUp(self):
        super(TestWorldWithSuccessfullyLoadedWorld, self).setUp()

        self.worldPath = os.path.join('worlds', 'mc2')
        self.world = World(self.worldPath)