Commit 90ae3a25 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

test File intensively

parent 419cc9fd
Pipeline #2431 failed with stage
...@@ -86,7 +86,7 @@ class File: ...@@ -86,7 +86,7 @@ class File:
f"{self.obs_id if obs_id is None else str(obs_id)}_" f"{self.obs_id if obs_id is None else str(obs_id)}_"
f"{self.detector if detector is None else str(detector)}_" f"{self.detector if detector is None else str(detector)}_"
f"L{self.level if level is None else str(level)}_" 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)}", f"{self.ext if ext is None else str(ext)}",
) )
......
...@@ -21,3 +21,41 @@ class TestFile(unittest.TestCase): ...@@ -21,3 +21,41 @@ class TestFile(unittest.TestCase):
) )
file = File(file_path, new_dir="/pipeline/output") file = File(file_path, new_dir="/pipeline/output")
self.assertTrue(file.mo.groupdict() is not None) 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"
),
)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment