In [2]:
import unittest
import sys
class MyTest(unittest.TestCase):
pass
In [3]:
%run ../../utils/load_notebook.py # импортируем функцию загрузки ноутбука
In [4]:
from photometry import * # загружаем функции
In [5]:
#TODO: добавить тест на калибровку
bell_mass_to_light(1., 'I', 'B-R')
Out[5]:
In [6]:
MyTest.test1 = lambda self: self.assertAlmostEqual(bell_mass_to_light(1., 'I', 'B-R'), 1.297179270983)
In [10]:
mu_eff = 18.37
r_eff = 8.8
n = 2.3
MyTest.test2 = lambda self: self.assertAlmostEqual(mu_bulge(10., mu_eff=mu_eff, r_eff=r_eff, n=n),
mu_bulge2(10., mu_eff=mu_eff, r_eff=r_eff, n=n), places=3)
In [11]:
suite = unittest.TestLoader().loadTestsFromTestCase(MyTest)
unittest.TextTestRunner(verbosity=1, stream=sys.stderr).run(suite)
Out[11]: