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
4e92892c
Commit
4e92892c
authored
Dec 15, 2023
by
BO ZHANG
🏀
Browse files
update module headers
parent
a5ee2b51
Pipeline
#2424
failed with stage
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tests/test_data_manager.py
deleted
100644 → 0
View file @
a5ee2b51
# """
# Identifier: KSC-SJ4-tests/test_data_manager.py
# Name: test_data_manager.py
# Description: data manager unit test
# Author: Bo Zhang
# Created: 2022-09-13
# Modified-History:
# 2022-09-13, Bo Zhang, created
# 2022-09-29, Bo Zhang, added test for CsstMbiDataManager
# 2022-10-28, Bo Zhang, deleted unit test for CsstMsDataManager
# """
# import os
# import unittest
#
# from csst_common.data_manager import CsstMsDataManager
# from csst_common.params import CSST_PARAMS as CP
#
# dir_unittest = "/nfsdata/share/pipeline-unittest/csst_common"
#
#
# class TestCsstMsDataManager(unittest.TestCase):
# def setUp(self) -> None:
# self.dm_mbi = CsstMsDataManager.quickstart(
# ver_sim="C6.2", datatype="mbi", dir_l1=dir_unittest, exposure_id=100)
# self.dm_sls = CsstMsDataManager.quickstart(
# ver_sim="C6.2", datatype="sls", dir_l1=dir_unittest, exposure_id=100)
# self.dm_mbi.target_detectors = None
# self.dm_sls.target_detectors = None
#
# def test_mbi_data_existence(self):
# self.assertTrue(self.dm_mbi.target_detectors == CP["mbi"]["detectors"])
# self.assertTrue(os.path.exists(self.dm_mbi.l0_detector(6)))
# self.assertTrue(os.path.exists(self.dm_mbi.l0_log(6)))
# self.assertTrue(os.path.exists(self.dm_mbi.l0_cat(6)))
# self.assertTrue(os.path.exists(self.dm_mbi.l0_crs(6)))
# self.assertTrue(isinstance(self.dm_mbi.l1_detector(6, post="img.fits"), str))
# self.assertTrue(isinstance(self.dm_mbi.l1_file(pipeline_id="some_file.ext", comment="a demo file"), str))
#
# def test_sls_data_existence(self):
# self.assertTrue(self.dm_sls.target_detectors == CP["sls"]["detectors"])
# self.assertTrue(os.path.exists(self.dm_sls.l0_detector(1)))
# self.assertTrue(os.path.exists(self.dm_sls.l0_log(1)))
# self.assertTrue(os.path.exists(self.dm_sls.l0_cat(1)))
# self.assertTrue(os.path.exists(self.dm_sls.l0_crs(1)))
# self.assertTrue(isinstance(self.dm_sls.l1_detector(1, post="flt.fits"), str))
# self.assertTrue(isinstance(self.dm_sls.l1_file(pipeline_id="some_file.ext", comment="a demo file"), str))
#
# # DFS is not always available
# # def test_dfs_is_available(self):
# # self.assertTrue(self.dm_mbi.dfs_is_available())
tests/test_decorator.py
View file @
4e92892c
"""
Identifier: tests/test_decorator.py
Name: test_decorator.py
Description: test decorator
Author: Bo Zhang
Created: 2023-12-15
Modified-History:
2023-12-10, Bo Zhang, add TestDecorator
2023-12-15, Bo Zhang, add module header
"""
import
unittest
from
csst_common.status
import
CsstStatus
,
CsstResult
from
csst_common
import
parameterized_module_decorator
from
csst_common.status
import
CsstStatus
,
CsstResult
class
TestDecorator
(
unittest
.
TestCase
):
...
...
tests/test_file.py
View file @
4e92892c
"""
Identifier: tests/test_file.py
Name: test_file.py
Description: test File class
Author: Bo Zhang
Created: 2023-12-13
Modified-History:
2023-12-13, Bo Zhang, add TestFile
2023-12-15, Bo Zhang, add module header
"""
import
unittest
from
csst_common
import
File
class
TestFile
(
unittest
.
TestCase
):
def
test_
parameterized_module_decorator
(
self
):
def
test_
file
(
self
):
file_path
=
(
"/dfs_root/L0/MSC/SCI/61605/10160000072/MS/"
"CSST_MSC_MS_SCIE_20270719043315_20270719043545_10160000072_07_L0_V01.fits"
...
...
tests/test_fits_header_ops.py
View file @
4e92892c
"""
Identifier: tests/test_fits_header_ops.py
Name: test_fits_header_ops.py
Description: test append_header
Author: Bo Zhang
Created: 2023-12-15
Modified-History:
2023-12-15, Bo Zhang, add TestAppendHeader
"""
import
unittest
from
csst_common.io
import
append_header
from
astropy.io
import
fits
from
csst_common.io
import
append_header
class
Test
File
(
unittest
.
TestCase
):
class
Test
AppendHeader
(
unittest
.
TestCase
):
def
test_append_header
(
self
):
h1
=
fits
.
Header
()
h2
=
fits
.
Header
()
...
...
tests/test_status.py
View file @
4e92892c
...
...
@@ -3,12 +3,13 @@ Identifier: tests/test_status.py
Name: test_status.py
Description: test CsstStatus
Author: Bo Zhang
Created: 2022-
09-13
Created: 2022-
10-04
Modified-History:
2022-
09-13
, Bo Zhang, created
202
2-09
-1
3
, Bo Zhang,
added CsstMbiDataManager
2022-
10-04
, Bo Zhang, created
, add CsstStatus test
202
3-12
-1
0
, Bo Zhang,
rename class
"""
import
unittest
from
csst_common.status
import
CsstStatus
...
...
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