Skip to content
GitLab
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
Aug 23, 2022
by
BO ZHANG
🏀
Browse files
added unit test
parent
89919a4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/test_flip_image.py
0 → 100644
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
()
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