test_mci_level0.py 1.05 KB
Newer Older
Wei Shoulin's avatar
mci 0-1  
Wei Shoulin committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import unittest

from csst_dfs_api_local.mci import Level0DataApi

class MCILevel0DataApiTestCase(unittest.TestCase):

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

    def test_find(self):
        recs = self.api.find(obs_id = '300000055', obs_type = 'sky', limit = 0)
        print('find:', recs)

    def test_get(self):
        rec = self.api.get(id = 31)
        print('get:', rec)

    def test_update_proc_status(self):
        rec = self.api.update_proc_status(id = 31, status = 6)
        print('update_proc_status:', rec)

    def test_update_qc0_status(self):
        rec = self.api.update_qc0_status(id = 31, status = 7)
        print('update_qc0_status:', rec)

    def test_write(self):
        rec = self.api.write(
            obs_id = '0000013',
            detector_no = "01",
            obs_type = "sky",            
            obs_time = "2021-06-06 11:12:13",
            exp_time = 150,
            detector_status_id = 3,
            filename = "MSC_00001234",
            file_path = "/opt/MSC_00001234.fits")
        print('write:', rec)