Skip to content

Commit

Permalink
Test for intensity added
Browse files Browse the repository at this point in the history
  • Loading branch information
vaibhav4595 committed Mar 8, 2015
1 parent dca3806 commit d71b027
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tardis/tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,22 @@
import pytest
from astropy import units as u
from tardis import atomic
from tardis.util import species_string_to_tuple, parse_quantity, element_symbol2atomic_number, atomic_number2element_symbol, reformat_element_symbol, MalformedQuantityError
from tardis.util import species_string_to_tuple, parse_quantity, element_symbol2atomic_number, atomic_number2element_symbol, reformat_element_symbol, MalformedQuantityError, intensity_black_body
from astropy import constants

k_B_cgs = constants.k_B.cgs.value
c_cgs = constants.c.cgs.value
h_cgs = constants.h.cgs.value
m_e_cgs = constants.m_e.cgs.value
e_charge_gauss = constants.e.gauss.value

testdata = [(10**4, 1092, 3.3550151563259252e-26),
(10**6, 1365, 4.1937684951576179e-22),
(10**7, 1683, 5.1707776564400651e-20)]

@pytest.mark.parametrize("nu,T,expected", testdata)
def test_intensity_black_body(nu, T, expected):
assert intensity_black_body(nu, T) == expected

def test_quantity_parser_normal():
q1 = parse_quantity('5 km/s')
Expand Down

0 comments on commit d71b027

Please sign in to comment.