Commit 5e2fd0cc authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

added unit test for CsstMbiDataManager

parent 4a87091c
...@@ -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)
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