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
GitLab 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
2baf041b
Commit
2baf041b
authored
5 years ago
by
jack-parsons
Browse files
Options
Downloads
Patches
Plain Diff
Fixing the Gitlab sample_test
parent
bc9d22c7
Branches
Branches containing commit
No related tags found
1 merge request
!23
Merge in Jack's changes
Pipeline
#844
passed
5 years ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/sample_test.py
+19
-2
19 additions, 2 deletions
tests/sample_test.py
with
19 additions
and
2 deletions
tests/sample_test.py
+
19
−
2
View file @
2baf041b
...
...
@@ -31,8 +31,8 @@ class TestBasicFunction(unittest.TestCase):
self
.
assertEqual
(
s
,
"
<class
'
module
'
>
"
)
def
test_rotate
(
self
):
stlPath
=
"
sample_stl_sphere_BIN.stl
"
from
AmpScan.core
import
AmpObject
stlPath
=
self
.
get_path
(
"
sample_stl_sphere_BIN.stl
"
)
Amp
=
AmpObject
(
stlPath
)
s
=
str
(
type
(
Amp
))
self
.
assertEqual
(
s
,
"
<class
'
AmpScan.core.AmpObject
'
>
"
,
"
Not expected Object
"
)
...
...
@@ -42,12 +42,29 @@ class TestBasicFunction(unittest.TestCase):
def
test_trim
(
self
):
# a new test for the trim module
stlPath
=
"
sample_stl_sphere_BIN.stl
"
stlPath
=
self
.
get_path
(
"
sample_stl_sphere_BIN.stl
"
)
from
AmpScan.core
import
AmpObject
Amp
=
AmpObject
(
stlPath
)
#with self.assertRaises(TypeError):
#Amp.planarTrim([], plane=[])
def
get_path
(
self
,
filename
):
"""
Method to get the absolute path to the testing files
:param filename: Name of the file in tests folder
:return: The absolute path to the file
"""
# Check if the parent directory is tests (this is for Pycharm unittests)
if
os
.
path
.
basename
(
os
.
getcwd
())
==
"
tests
"
:
# This is for Pycharm testing
stlPath
=
filename
else
:
# This is for the Gitlab testing
stlPath
=
os
.
path
.
abspath
(
os
.
getcwd
())
+
"
\\
tests
\\
"
+
filename
return
stlPath
if
__name__
==
'
__main__
'
:
unittest
.
main
()
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