test_facility_brick.py 808 Bytes
Newer Older
Wei Shoulin's avatar
c3  
Wei Shoulin committed
1
2
3
import os
import unittest

Wei Shoulin's avatar
brick    
Wei Shoulin committed
4
from csst_dfs_api.facility.brick import BrickApi
Wei Shoulin's avatar
c3  
Wei Shoulin committed
5

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

    def setUp(self):
Wei Shoulin's avatar
brick    
Wei Shoulin committed
9
        self.api = BrickApi()
Wei Shoulin's avatar
c3  
Wei Shoulin committed
10
11

    def test_find(self):
Wei Shoulin's avatar
Wei Shoulin committed
12
        recs = self.api.find(limit = 0)
Wei Shoulin's avatar
c3  
Wei Shoulin committed
13
14
15
        print('find:', recs)

    def test_get(self):
Wei Shoulin's avatar
Wei Shoulin committed
16
        rec = self.api.get(id=17)
Wei Shoulin's avatar
c3  
Wei Shoulin committed
17
18
        print('get:', rec)

Wei Shoulin's avatar
Wei Shoulin committed
19
20
21
    def test_write(self):
        rec = self.api.write(id=1, ra = 3.2, dec = 3.3, boundingbox = '12,12')
        print('test_write:', rec)
Wei Shoulin's avatar
c3  
Wei Shoulin committed
22

Wei Shoulin's avatar
Wei Shoulin committed
23
24
25
26
27
28
29
    def test_find_obs_status(self):
        rec = self.api.find_obs_status(brick_id=1, band = 'r')
        print('find_obs_status:', rec)

    def test_find_level1_data(self):
        rec = self.api.find_level1_data(brick_id=1, level1_id = 1, module = 'msc')
        print('find_level1_data:', rec)