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_common
Commits
5e2fd0cc
Commit
5e2fd0cc
authored
Sep 29, 2022
by
BO ZHANG
🏀
Browse files
added unit test for CsstMbiDataManager
parent
4a87091c
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/test_data_manager.py
View file @
5e2fd0cc
...
@@ -6,12 +6,27 @@ Author: Bo Zhang
...
@@ -6,12 +6,27 @@ Author: Bo Zhang
Created: 2022-09-13
Created: 2022-09-13
Modified-History:
Modified-History:
2022-09-13, Bo Zhang, created
2022-09-13, Bo Zhang, created
2022-09-
13
, Bo Zhang,
fixed a bug
2022-09-
29
, Bo Zhang,
added test for CsstMbiDataManager
"""
"""
import
os
import
unittest
import
unittest
from
csst_common.data_manager
import
CsstMbiDataManager
from
csst_common.data_manager
import
CsstMbiDataManager
class
TestDataManager
(
unittest
.
TestCase
):
def
setUp
(
self
)
->
None
:
self
.
dm
=
CsstMbiDataManager
.
quickstart
(
ver_sim
=
"C5.2"
,
dir_l1
=
"."
,
exposure_id
=
100
)
def
test_l0data_existence
(
self
):
self
.
assertTrue
(
self
.
dm
.
available_detectors
==
18
)
self
.
assertTrue
(
os
.
path
.
exists
(
self
.
dm
.
l0_detector
(
6
)))
self
.
assertTrue
(
os
.
path
.
exists
(
self
.
dm
.
l0_log
(
6
)))
self
.
assertTrue
(
os
.
path
.
exists
(
self
.
dm
.
l0_cat
(
6
)))
self
.
assertTrue
(
os
.
path
.
exists
(
self
.
dm
.
l0_crs
(
6
)))
self
.
assertTrue
(
isinstance
(
self
.
dm
.
l1_detector
(
6
,
post
=
"img.fits"
),
str
))
self
.
assertTrue
(
isinstance
(
self
.
dm
.
l1_file
(
name
=
"some_file.ext"
,
comment
=
"a demo file"
),
str
))
class
TestParams
(
unittest
.
TestCase
):
class
TestParams
(
unittest
.
TestCase
):
def
test_params
(
self
):
def
test_params
(
self
):
self
.
assertTrue
(
True
)
self
.
assertTrue
(
True
)
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