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)
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 )
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
def setUp(self): super(TestWorldWithSuccessfullyLoadedWorld, self).setUp() self.worldPath = os.path.join("worlds", "mc2") self.world = World(self.worldPath)
def setUp(self): super(TestWorldWithSuccessfullyLoadedWorld, self).setUp() self.worldPath = os.path.join('worlds', 'mc2') self.world = World(self.worldPath)