Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
threevis
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
11
Issues
11
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
threevis
threevis
Commits
ee25de61
Commit
ee25de61
authored
Feb 22, 2018
by
Dario Seyb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed test function names so they get picked up by unit testing
parent
9698fc83
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
tests/test_indexed_attributes.py
tests/test_indexed_attributes.py
+8
-7
No files found.
tests/test_indexed_attributes.py
View file @
ee25de61
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
.
assertListE
qual
(
resolved_attrib
,
[
'a'
,
'b'
,
'c'
,
'a'
,
'c'
,
'd'
])
np
.
testing
.
assert_array_e
qual
(
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__'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment