test_sls_level2_spectra.py 1.13 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
17
18
19
20
21
22
23
24
import unittest

from csst_dfs_api.sls import Level2SpectraApi

class SLSLevel2SpectraTestCase(unittest.TestCase):

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

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

    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)

Wei Shoulin's avatar
Wei Shoulin committed
25
26
    def test_update_qc2_status(self):
        rec = self.api.update_qc2_status(id = 1, status = 7)
Wei Shoulin's avatar
Wei Shoulin committed
27
28
29
30
31
        print('update_qc1_status:', rec)

    def test_write(self):
        rec = self.api.write(
            level1_id=2, 
Wei Shoulin's avatar
Wei Shoulin committed
32
            file_type = "SPC",
Wei Shoulin's avatar
Wei Shoulin committed
33
34
            prc_status = 3,
            prc_time = '2021-10-22 11:12:13',
Wei Shoulin's avatar
Wei Shoulin committed
35
36
            filename = "MSC_MS_210525120000_100000000_20_cat.fits",
            file_path = "/opt/temp/csst/msc_data/MSC_MS_210525120000_100000000_20_cat.fits",
Wei Shoulin's avatar
Wei Shoulin committed
37
38
            pipeline_id = "P2")
        print('write:', rec)