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
90ae3a25
Commit
90ae3a25
authored
Dec 15, 2023
by
BO ZHANG
🏀
Browse files
test File intensively
parent
419cc9fd
Pipeline
#2431
failed with stage
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
csst_common/file.py
View file @
90ae3a25
...
...
@@ -86,7 +86,7 @@ class File:
f
"
{
self
.
obs_id
if
obs_id
is
None
else
str
(
obs_id
)
}
_"
f
"
{
self
.
detector
if
detector
is
None
else
str
(
detector
)
}
_"
f
"L
{
self
.
level
if
level
is
None
else
str
(
level
)
}
_"
f
"V
{
self
.
version
if
version
is
None
else
str
(
version
)
}
"
f
"V
{
self
.
version
if
version
is
None
else
str
(
version
)
.
zfill
(
2
)
}
"
f
"
{
self
.
ext
if
ext
is
None
else
str
(
ext
)
}
"
,
)
...
...
tests/test_file.py
View file @
90ae3a25
...
...
@@ -21,3 +21,41 @@ class TestFile(unittest.TestCase):
)
file
=
File
(
file_path
,
new_dir
=
"/pipeline/output"
)
self
.
assertTrue
(
file
.
mo
.
groupdict
()
is
not
None
)
self
.
assertEqual
(
file
.
derive0
(),
(
"/pipeline/output/"
"CSST_MSC_MS_SCIE_20270719043315_20270719043545_10160000072_07_L0_V01.fits"
),
)
self
.
assertEqual
(
file
.
derive1
(),
(
"/pipeline/output/"
"CSST_MSC_MS_SCIE_20270719043315_20270719043545_10160000072_07_L1_V01.fits"
),
)
self
.
assertEqual
(
file
.
derive1
(
version
=
2
),
(
"/pipeline/output/"
"CSST_MSC_MS_SCIE_20270719043315_20270719043545_10160000072_07_L1_V02.fits"
),
)
self
.
assertEqual
(
file
.
derive2
(),
(
"/pipeline/output/"
"CSST_MSC_MS_SCIE_20270719043315_20270719043545_10160000072_07_L2_V01.fits"
),
)
self
.
assertEqual
(
file
.
derive2
(
ext
=
".cat"
),
(
"/pipeline/output/"
"CSST_MSC_MS_SCIE_20270719043315_20270719043545_10160000072_07_L2_V01.cat"
),
)
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