Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
AmpScan
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Joshua Steer
AmpScan
Commits
74352164
Commit
74352164
authored
5 years ago
by
jack-parsons
Browse files
Options
Downloads
Patches
Plain Diff
Adding more tests to trim method
parent
27f2646a
No related branches found
No related tags found
1 merge request
!23
Merge in Jack's changes
Pipeline
#858
failed
5 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+1
-1
1 addition, 1 deletion
.gitlab-ci.yml
AmpScan/trim.py
+1
-1
1 addition, 1 deletion
AmpScan/trim.py
tests/test_trim.py
+9
-0
9 additions, 0 deletions
tests/test_trim.py
with
11 additions
and
2 deletions
.gitlab-ci.yml
+
1
−
1
View file @
74352164
tests
:
script
:
python -m unittest
-v
script
:
python -m
-v
unittest
discover tests
This diff is collapsed.
Click to expand it.
AmpScan/trim.py
+
1
−
1
View file @
74352164
...
...
@@ -31,7 +31,7 @@ class trimMixin(object):
>>>
amp
.
planarTrim
(
100
,
2
)
"""
if
isinstance
(
height
,
Number
):
if
isinstance
(
height
,
Number
)
and
isinstance
(
plane
,
int
)
:
# planar values for each vert on face
fv
=
self
.
vert
[
self
.
faces
,
plane
]
# Number points on each face are above cut plane
...
...
This diff is collapsed.
Click to expand it.
tests/test_trim.py
+
9
−
0
View file @
74352164
...
...
@@ -17,6 +17,15 @@ class TestTrim(unittest.TestCase):
def
test_trim
(
self
):
"""
Tests the trim method of AmpObject
"""
# Testing that the method runs
self
.
amp
.
planarTrim
(
0.6
,
plane
=
2
)
# Testing invalid data types raise TypeErrors
with
self
.
assertRaises
(
TypeError
):
self
.
amp
.
planarTrim
(
0.6
,
plane
=
[])
with
self
.
assertRaises
(
TypeError
):
self
.
amp
.
planarTrim
(
0.6
,
plane
=
0.9
)
with
self
.
assertRaises
(
TypeError
):
self
.
amp
.
planarTrim
([],
plane
=
[])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment