Commit ee25de61 authored by Dario Seyb's avatar Dario Seyb

fixed test function names so they get picked up by unit testing

parent 9698fc83
import unittest
import meshvis
import numpy as np
class IndexedAttributes(unittest.TestCase):
quad_verts = [[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]]
quad_faces_tri = [[0, 1, 2], [0, 2, 3]]
quad_verts = np.array([[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]])
quad_faces_tri = np.array([[0, 1, 2], [0, 2, 3]])
def point_attribute_tri(self):
def test_point_attribute_tri(self):
attrib = meshvis.PointAttribute(['a', 'b', 'c', 'd'])
resolved_attrib = meshvis.resolve_attributes(self.quad_faces_tri, [attrib])[0]
self.assertEqual(len(resolved_attrib), 6)
self.assertListEqual(resolved_attrib, ['a', 'b', 'c', 'a', 'c', 'd'])
np.testing.assert_array_equal(resolved_attrib, ['a', 'b', 'c', 'a', 'c', 'd'])
def face_attribute_tri(self):
def test_face_attribute_tri(self):
attrib = meshvis.FaceAttribute(['a', 'b'])
resolved_attrib = meshvis.resolve_attributes(self.quad_faces_tri, [attrib])[0]
self.assertEqual(len(resolved_attrib), 2)
self.assertListEqual(resolved_attrib, ['a', 'b'])
self.assertEqual(len(resolved_attrib), 6)
np.testing.assert_array_equal(resolved_attrib, ['a', 'a', 'a', 'b', 'b', 'b'])
if __name__ == '__main__':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment