Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-pipeline
csst_proto
Commits
e9a2ede9
Commit
e9a2ede9
authored
2 years ago
by
BO ZHANG
Browse files
Options
Download
Email Patches
Plain Diff
added unit test
parent
89919a4f
dev
main
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_flip_image.py
+21
-0
tests/test_flip_image.py
with
21 additions
and
0 deletions
+21
-0
tests/test_flip_image.py
0 → 100644
+
21
-
0
View file @
e9a2ede9
import
unittest
import
numpy
as
np
from
csst_proto.top_level_interface
import
flip_image
,
read_test_image
class
FlipImageTestCase
(
unittest
.
TestCase
):
def
test_flip_image
(
self
):
# flip test image
self
.
assertTrue
(
np
.
all
(
flip_image
(
read_test_image
())
==
np
.
array
([[
4
,
3
],
[
2
,
1
]]))
)
# the code fails for 1D array
with
self
.
assertRaises
(
AssertionError
):
flip_image
(
np
.
array
([
1
,
2
,
3
,
4
]))
if
__name__
==
"__main__"
:
unittest
.
main
()
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets