#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created by schaffer at 8/22/19 """ from pprint import pprint from unittest import TestCase from kis_tools.bbi.bbi_header import get_generic_header from kis_tools.bbi.util import get_bbi_wl, NoWavelengthError from kis_tools.generic.settings.settings import get_settings class TestBBI(TestCase): @classmethod def setUpClass(cls) -> None: cls.settings = get_settings("bbi") cls.obs_df = cls.settings.observations def test_bbi_header(self): header = get_generic_header() pprint(header) 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)