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
271af079
Commit
271af079
authored
6 years ago
by
Joshua Steer
Browse files
Options
Downloads
Patches
Plain Diff
Added new test files
parent
4090d91b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/core_tests.py
+5
-0
5 additions, 0 deletions
tests/core_tests.py
tests/sample_test_local.py
+53
-0
53 additions, 0 deletions
tests/sample_test_local.py
with
58 additions
and
0 deletions
tests/core_tests.py
0 → 100644
+
5
−
0
View file @
271af079
# -*- coding: utf-8 -*-
"""
Testing suite for the core functionality
"""
This diff is collapsed.
Click to expand it.
tests/sample_test_local.py
0 → 100644
+
53
−
0
View file @
271af079
import
unittest
import
os
import
sys
class
TestBasicFunction
(
unittest
.
TestCase
):
def
SetUp
(
self
):
modPath
=
os
.
path
.
abspath
(
os
.
getcwd
())
sys
.
path
.
insert
(
0
,
modPath
)
def
test_running
(
self
):
print
(
"
Running sample_test.py
"
)
self
.
assertTrue
(
True
)
def
test_python_imports
(
self
):
import
numpy
,
scipy
,
matplotlib
,
vtk
,
AmpScan
.
core
s
=
str
(
type
(
numpy
))
self
.
assertEqual
(
s
,
"
<class
'
module
'
>
"
)
s
=
str
(
type
(
scipy
))
self
.
assertEqual
(
s
,
"
<class
'
module
'
>
"
)
s
=
str
(
type
(
matplotlib
))
self
.
assertEqual
(
s
,
"
<class
'
module
'
>
"
)
s
=
str
(
type
(
vtk
))
self
.
assertEqual
(
s
,
"
<class
'
module
'
>
"
)
s
=
str
(
type
(
AmpScan
.
core
))
self
.
assertEqual
(
s
,
"
<class
'
module
'
>
"
,
"
Failed import: AmpScan.core
"
)
@unittest.expectedFailure
def
test_failure
(
self
):
s
=
str
(
type
(
"
string
"
))
self
.
assertEqual
(
s
,
"
<class
'
module
'
>
"
)
def
test_rotate
(
self
):
stlPath
=
os
.
path
.
abspath
(
os
.
getcwd
())
+
"
/sample_stl_sphere_BIN.stl
"
from
AmpScan.core
import
AmpObject
Amp
=
AmpObject
(
stlPath
)
s
=
str
(
type
(
Amp
))
self
.
assertEqual
(
s
,
"
<class
'
AmpScan.core.AmpObject
'
>
"
,
"
Not expected Object
"
)
with
self
.
assertRaises
(
TypeError
):
Amp
.
rotateAng
(
7
)
Amp
.
rotateAng
({})
def
test_trim
(
self
):
# a new test for the trim module
stlPath
=
os
.
path
.
abspath
(
os
.
getcwd
())
+
"
/sample_stl_sphere_BIN.stl
"
from
AmpScan.core
import
AmpObject
Amp
=
AmpObject
(
stlPath
)
#with self.assertRaises(TypeError):
#Amp.planarTrim([], plane=[])
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