surfaces/surf/test/test_polymesh.py

28 lines
732 B
Python
Raw Normal View History

2012-05-07 22:17:46 -07:00
import json
import os
import unittest
from surf.geometry import PolygonMesh
class TestPM(unittest.TestCase):
def setUp(self):
path, file_name = os.path.split(__file__)
self.samples_dir = os.path.join(path, os.pardir, os.pardir,
'blender', 'samples')
2012-05-29 16:33:28 -07:00
cube_file_name = os.path.join(self.samples_dir, 'cube.json')
with open(cube_file_name) as cube_file:
self.cube = json.load(cube_file)
2012-05-07 22:17:46 -07:00
def test_cube_load(self):
p = PolygonMesh(**self.cube)
v = p.vertices[0]
self.assertAlmostEqual(v.x, -1.0)
self.assertAlmostEqual(v.y, -1.0)
self.assertAlmostEqual(v.z, -1.0)
2012-05-07 22:17:46 -07:00
if __name__ == '__main__':
unittest.main(verbosity=3)