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_common
Commits
90ae3a25
Commit
90ae3a25
authored
1 year ago
by
BO ZHANG
Browse files
Options
Download
Email Patches
Plain Diff
test File intensively
parent
419cc9fd
dev
main
No related merge requests found
Pipeline
#2431
failed with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
csst_common/file.py
+1
-1
csst_common/file.py
tests/test_file.py
+38
-0
tests/test_file.py
with
39 additions
and
1 deletion
+39
-1
csst_common/file.py
+
1
-
1
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
)
}
"
,
)
...
...
This diff is collapsed.
Click to expand it.
tests/test_file.py
+
38
-
0
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"
),
)
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