test_sls_level1.py 1.35 KB
Newer Older
Wei Shoulin's avatar
Wei Shoulin committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import unittest

from csst_dfs_api.sls import Level1DataApi

class SLSResult1TestCase(unittest.TestCase):

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

    def test_find(self):
        recs = self.api.find(
                level0_id='0000223', 
                create_time = ("2021-06-01 11:12:13","2021-06-08 11:12:13")
            )
        print('find:', recs)

Wei Shoulin's avatar
Wei Shoulin committed
17
18
19
20
    def test_find_by_prc_status(self):
        recs = self.api.find_by_prc_status()
        print('test_find_by_prc_status:', recs)

Wei Shoulin's avatar
Wei Shoulin committed
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
    def test_get(self):
        rec = self.api.get(id = 1)
        print('get:', rec)

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

    def test_update_qc1_status(self):
        rec = self.api.update_qc1_status(id = 1, status = 7)
        print('update_qc1_status:', rec)

    def test_write(self):
        rec = self.api.write(
            level0_id='0000223', 
            data_type = "sci",
            prc_params = "/opt/dddasd.params",
            prc_status = 3,
            prc_time = '2021-10-22 11:12:13',
            filename = "MSC_MS_210525121500_100000001_09_raw",
            file_path = "/opt/temp/csst/MSC_MS_210525121500_100000001_09_raw.fits",
            pipeline_id = "P2",
            refs = {'dark': 1, 'bias': 2, 'flat': 3 })
        print('write:', rec)