예제 #1
0
    def test_save_cuboid(self):
        """Tests the saving of cuboids."""
        path = self.test_dir / "row_cuboid.json"
        save_items(self.cube, path)
        items = load_items(path, 3)

        self.assertEqual(items, self.cube)

        # validate failed dimension check
        with self.assertRaises(ValueError):
            load_items(path, 2)

        # validate the 'any dimensions' call to load_items
        items = load_items(path)
        self.assertEqual(items, self.cube)
예제 #2
0
    def test_save_profile(self):
        """Tests the saving of profiles."""
        path = self.test_dir / "row_profile.json"
        save_items(self.middle_profile, path)
        items = load_items(path, 2)

        self.assertEqual(items, self.middle_profile)
예제 #3
0
    def test_save_row(self):
        """Tests the saving of rows."""
        path = self.test_dir / "row_test.json"
        save_items(self.blue_row, path)
        items = load_items(path, 1)

        self.assertEqual(items, self.blue_row)
예제 #4
0
파일: test_blocks.py 프로젝트: conqp/mcwb
    def test_XY(self):
        world_cube = Blocks(cast(Client, self.client), self.start, self.cube)
        for rot in range(1, 4):
            world_cube.rotate(Planes3d.XY)
            rotated = load_items(cubes_dir / f"RGBrotateXY{rot}.cube")

            self.assertTrue(self.client.compare(self.start, rotated))

        # 4th rotation returns to orignal state
        world_cube.rotate(Planes3d.XY)
        self.assertTrue(self.client.compare(self.start, self.cube))
예제 #5
0
파일: test_blocks.py 프로젝트: conqp/mcwb
    def test_YZ(self):
        world_cube = Blocks(cast(Client, self.client), self.start, self.cube)
        world_cube.rotate(Planes3d.YZ)
        rotated = load_items(cubes_dir / "RGBrotateYZ1.cube")

        self.assertTrue(self.client.compare(self.start, rotated))
예제 #6
0
파일: test_blocks.py 프로젝트: conqp/mcwb
 def setUp(self):
     self.client = MockClient()
     self.cube = load_items(cubes_dir / "RGB.cube")
     self.start = Vec3(0, 0, 0)