test_facility_observation.py 1.03 KB
Newer Older
Wei Shoulin's avatar
c3  
Wei Shoulin committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import os
import unittest
from astropy.io import fits

from csst_dfs_api.facility.observation import ObservationApi

class FacilityObservationTestCase(unittest.TestCase):

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

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

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

    def test_update_proc_status(self):
Wei Shoulin's avatar
demo    
Wei Shoulin committed
21
        rec = self.api.update_proc_status(obs_id = 17, status = 3, )
Wei Shoulin's avatar
c3  
Wei Shoulin committed
22
23
24
        print('update_proc_status:', rec)

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

Wei Shoulin's avatar
demo    
Wei Shoulin committed
28
29
30
31
32
33
34
35
36
    # def test_write(self):
    #     rec = self.api.write(
    #         obs_time = "2021-06-06 11:12:13",
    #         exp_time = 150,
    #         module_id = "MSC",
    #         obs_type = "sci",
    #         facility_status_id = 3,
    #         module_status_id = 3)
    #     print('write:', rec)