test_mbi_level2co.py 1.1 KB
Newer Older
Wei Shoulin's avatar
Wei Shoulin committed
1
2
import unittest

Wei Shoulin's avatar
s-v    
Wei Shoulin committed
3
from csst_dfs_api.mbi import Level2CoApi
Wei Shoulin's avatar
Wei Shoulin committed
4

Wei Shoulin's avatar
Wei Shoulin committed
5
class MBILevel2CoDataTestCase(unittest.TestCase):
Wei Shoulin's avatar
Wei Shoulin committed
6
7
8
9
10
11

    def setUp(self):
        self.api = Level2CoApi()

    def test_find(self):
        recs = self.api.find(
Wei Shoulin's avatar
Wei Shoulin committed
12
13
            data_type='CAT',
            create_time = ("2022-06-15 11:12:13", "2024-06-16 11:12:13"))
Wei Shoulin's avatar
Wei Shoulin committed
14
15
16
        print('find:', recs)

    def test_get(self):
Wei Shoulin's avatar
Wei Shoulin committed
17
        rec = self.api.get(id = 4)
Wei Shoulin's avatar
Wei Shoulin committed
18
19
20
        print('get:', rec)

    def test_update_proc_status(self):
Wei Shoulin's avatar
Wei Shoulin committed
21
        rec = self.api.update_proc_status(id = 4, status = 9)
Wei Shoulin's avatar
Wei Shoulin committed
22
23
24
        print('update_proc_status:', rec)

    def test_update_qc2_status(self):
Wei Shoulin's avatar
Wei Shoulin committed
25
        rec = self.api.update_qc2_status(id = 4, status = 9)
Wei Shoulin's avatar
Wei Shoulin committed
26
27
28
29
        print('update_qc2_status:', rec)

    def test_write(self):
        rec = self.api.write(
Wei Shoulin's avatar
Wei Shoulin committed
30
            data_type = "CAT",
Wei Shoulin's avatar
Wei Shoulin committed
31
            prc_status = 3,
Wei Shoulin's avatar
Wei Shoulin committed
32
            prc_time = '2023-07-01 11:12:13',
Wei Shoulin's avatar
Wei Shoulin committed
33
            filename = "MSC_MS_210525120000_100000000_20_cat.fits",
Wei Shoulin's avatar
Wei Shoulin committed
34
35
36
            file_path = "/opt/temp/csst/msc_data/MSC_MS_210525120000_100000000_20_cat.fits",
            pipeline_id = "COMBI-2"
        )
Wei Shoulin's avatar
Wei Shoulin committed
37
        print('write:', rec)