test_facility_level2producer.py 835 Bytes
Newer Older
Wei Shoulin's avatar
c3  
Wei Shoulin committed
1
2
3
4
import os
import unittest
from astropy.io import fits

Wei Shoulin's avatar
brick    
Wei Shoulin committed
5
from csst_dfs_api.facility.level2producer import Level2ProducerApi
Wei Shoulin's avatar
c3  
Wei Shoulin committed
6

Wei Shoulin's avatar
brick    
Wei Shoulin committed
7
class FacilityLevel2ProducerTestCase(unittest.TestCase):
Wei Shoulin's avatar
c3  
Wei Shoulin committed
8
9

    def setUp(self):
Wei Shoulin's avatar
brick    
Wei Shoulin committed
10
        self.api = Level2ProducerApi()
Wei Shoulin's avatar
c3  
Wei Shoulin committed
11
12
13
14
15
16

    def test_find(self):
        recs = self.api.find(module_id="MSC",limit = 0)
        print('find:', recs)

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

    def test_update_proc_status(self):
Wei Shoulin's avatar
Wei Shoulin committed
23
        rec = self.api.update_proc_status(obs_id='0000017', status = 3, )
Wei Shoulin's avatar
c3  
Wei Shoulin committed
24
25
26
        print('update_proc_status:', rec)

    def test_update_qc0_status(self):
Wei Shoulin's avatar
Wei Shoulin committed
27
        rec = self.api.update_qc0_status(obs_id='0000017', status = 3, )
Wei Shoulin's avatar
c3  
Wei Shoulin committed
28
        print('update_qc0_status:', rec)