update tests to unittest2 (or unittest py2.7)

This commit is contained in:
Stephen M. McQuay
2012-06-08 11:47:19 -06:00
parent a45c84c183
commit 7559887e0f
7 changed files with 4 additions and 28 deletions
+27
View File
@@ -0,0 +1,27 @@
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')
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)
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)
if __name__ == '__main__':
unittest.main(verbosity=3)