def after_class_creation(cls):
     r"""Actions to be taken during class construction."""
     parent.TestJSONObjectMetaschemaType.after_class_creation(cls)
     cls._value = _test_value
     cls._fulldef = {'type': cls.get_import_cls().name}
     cls._typedef = {'type': cls._fulldef['type']}
     cls._valid_encoded = [cls._fulldef]
     cls._valid_decoded = [
         cls._value,
         PlyMetaschemaType.PlyDict(**_test_value), {
             'vertices': [],
             'faces': [],
             'alt_verts': copy.deepcopy(_test_value['vertices'])
         }, _test_value_int64
     ]
     if PlyMetaschemaType.trimesh:
         cls._valid_decoded.append(
             PlyMetaschemaType.PlyDict(**_test_value).as_trimesh())
     cls._invalid_encoded = [{}]
     cls._invalid_decoded = [{
         'vertices': [{k: 0.0
                       for k in 'xyz'}],
         'faces': [{
             'vertex_index': [0, 1, 2]
         }]
     }]
     cls._compatible_objects = [(cls._value, cls._value, None)]
     cls._encode_data_kwargs = {'comments': ['Test comment']}
Esempio n. 2
0
 def valid_decoded(self, value, ply_test_value, ply_test_value_int64):
     r"""list: Objects that are valid under this type."""
     out = [value,
            PlyMetaschemaType.PlyDict(**ply_test_value),
            {'vertices': [], 'faces': [],
             'alt_verts': copy.deepcopy(ply_test_value['vertices'])},
            ply_test_value_int64]
     if PlyMetaschemaType.trimesh:
         out.append(PlyMetaschemaType.PlyDict(**ply_test_value).as_trimesh())
     return out
Esempio n. 3
0
 def __init__(self, *args, **kwargs):
     super(TestPlyMetaschemaType, self).__init__(*args, **kwargs)
     self._value = _test_value
     self._fulldef = {'type': self.import_cls.name}
     self._typedef = {'type': self.import_cls.name}
     self._valid_encoded = [self._fulldef]
     self._valid_decoded = [self._value,
                            PlyMetaschemaType.PlyDict(**_test_value),
                            {'vertices': [], 'faces': [],
                             'alt_verts': copy.deepcopy(_test_value['vertices'])},
                            _test_value_int64]
     self._invalid_encoded = [{}]
     self._invalid_decoded = [{'vertices': [{k: 0.0 for k in 'xyz'}],
                               'faces': [{'vertex_index': [0, 1, 2]}]}]
     self._compatible_objects = [(self._value, self._value, None)]
     self._encode_data_kwargs = {'comments': ['Test comment']}