def test_q_3d(self):
        logging.debug('')
        logging.debug('test_q_3d')

        logger = logging.getLogger()
        wedge = create_wedge_3d((30, 20, 10), 5., 0.5, 2., 30.)

        # Big-endian binary.
        write_plot3d_q(wedge, 'be-binary.xyz', 'be-binary.q', logger=logger,
                       big_endian=True, unformatted=False)
        domain = read_plot3d_q('be-binary.xyz', 'be-binary.q', logger=logger,
                               multiblock=False, big_endian=True,
                               unformatted=False)
        self.assertFalse(domain.is_equivalent(wedge, logger=logger))
        domain.rename_zone('xyzzy', domain.zone_1)
        self.assertTrue(domain.is_equivalent(wedge, logger=logger))

        # Little-endian unformatted.
        write_plot3d_q(domain, 'unformatted.xyz', 'unformatted.q',
                       logger=logger)
        domain = read_plot3d_q('unformatted.xyz', 'unformatted.q',
                               logger=logger, multiblock=False)
        self.assertFalse(domain.is_equivalent(wedge, logger=logger))
        domain.rename_zone('xyzzy', domain.zone_1)
        self.assertTrue(domain.is_equivalent(wedge, logger=logger))

        # Multiblock.
        wedge2 = create_wedge_3d((29, 19, 9), 5., 2.5, 4., 30.)
        domain.add_domain(wedge2)
        write_plot3d_q(domain, 'unformatted.xyz', 'unformatted.q',
                       logger=logger)
        domain = read_plot3d_q('unformatted.xyz', 'unformatted.q',
                               logger=logger)

        shape = read_plot3d_shape('unformatted.xyz', logger=logger)
        self.assertEqual(shape, [(30, 20, 10), (29, 19, 9)])

        # Errors.
        try:
            read_plot3d_q('unformatted.xyz', 'unformatted.q', blanking=True,
                          logger=logger, multiblock=False)
        except NotImplementedError as exc:
            self.assertEqual(str(exc), 'blanking not supported yet')
        else:
            self.fail('Expected NotImplementedError')

        try:
            read_plot3d_q('unformatted.xyz', 'unformatted.q', planes=True,
                          logger=logger, multiblock=False)
        except __HOLE__ as exc:
            self.assertEqual(str(exc), 'planar format not supported yet')
        else:
            self.fail('Expected NotImplementedError')

        assert_raises(self, "write_plot3d_q(logger, 'u.xyz', 'u.q')",
                      globals(), locals(), TypeError,
                      "'domain' argument must be a DomainObj or Zone")

        assert_raises(self, "write_plot3d_f(logger, 'u.xyz', 'u.f')",
                      globals(), locals(), TypeError,
                      "'domain' argument must be a DomainObj or Zone")

        assert_raises(self, "write_plot3d_grid(logger, 'u.xyz')",
                      globals(), locals(), TypeError,
                      "'domain' argument must be a DomainObj or Zone")

        wedge = create_wedge_3d((30, 20, 10), 5., 0.5, 2., 30.)
        delattr(wedge.xyzzy.flow_solution, 'mach')
        assert_raises(self, "write_plot3d_q(wedge, 'u.xyz', 'u.q')",
                      globals(), locals(), AttributeError,
                      "zone xyzzy flow_solution is missing ['mach']")

        assert_raises(self, "write_plot3d_f(wedge, 'u.xyz', 'u.f', ['froboz'])",
                      globals(), locals(), AttributeError,
                      "zone xyzzy flow_solution is missing ['froboz']")
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/datatypes/domain/test/test_plot3d.py/TestCase.test_q_3d