def testWavenumberConversion(self): a = Transition(500 * u.nm, 26, 1) a.wavenumber = 2500000 * 1 / u.m assert a.wavelength.value == pytest.approx(4e-5) assert a.wavelength.units == u.cm assert a.wavenumber.units == u.cm**-1
def testWavenumberAssigment(self): a = Transition(500 * u.nm, 26, 1) assert a.wavenumber.value == pytest.approx(20000) a.wavenumber = 20000 * u.cm**-1 assert a.wavelength.value == pytest.approx(5e-5)