test_bbi.py 1017 Bytes
Newer Older
1
2
3
4
5
6
7
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
Created by schaffer at 8/22/19

"""
8
from pprint import pprint
9
10
from unittest import TestCase

11
from kis_tools.bbi.bbi_header import get_generic_header
12
from kis_tools.bbi.util import get_bbi_wl, NoWavelengthError
13
from kis_tools.generic.settings.settings import get_settings
14

15

Carl Schaffer's avatar
Carl Schaffer committed
16
class TestBBI(TestCase):
17
18
19
20
21
    @classmethod
    def setUpClass(cls) -> None:
        cls.settings = get_settings("bbi")
        cls.obs_df = cls.settings.observations

22
23
24
    def test_bbi_header(self):
        header = get_generic_header()
        pprint(header)
25
26
27
28
29
30
31
32

    def test_get_wl(self):
        working_teststrings = ["20170522_003_WL854", "bbi_20170523-092204_001_WL589_location_preview.png", ]
        for ts in working_teststrings:
            self.assertIsInstance(get_bbi_wl(ts), int)
        error_teststrings = ["20170522_003_WLABC", "bbi_20170523-092204_001_location_preview.png", ]
        for ts in error_teststrings:
            self.assertRaises(NoWavelengthError, get_bbi_wl, ts)