test_ifs_refs.py 700 Bytes
Newer Older
Xie Zhou's avatar
update  
Xie Zhou 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 logging
import unittest

from csst_dfs_api_local.ifs import RefFitsApi

log = logging.getLogger('csst')
class IFSFitsTestCase(unittest.TestCase):

    def setUp(self):
        self.api = RefFitsApi()
        self.api.scan2db()

    def test_find(self):
        path = self.api.find(obs_time=300, type='Flat')
        log.info('find', path)
        path = self.api.find(fits_id='CCD1_Flat_img')
        log.info('find', path)
    
    def test_read(self):
        file = self.api.read(fits_id='CCD1_Flat_img')
        log.info('read', str(type(file)))
        path = self.api.find(obs_time=300, type='Flat')
        file = self.api.read(file_path=path)
        log.info('read', str(type(file)))