def test_failure_quick_conversion_failure_with_same_input(self): energy = UnitFactory.Instance().create("Energy") self.assertRaises(RuntimeError, energy.quickConversion, "Energy")
def test_quick_conversion_with_unit_input(self): energy = UnitFactory.Instance().create("Energy") wavelength = UnitFactory.Instance().create("Wavelength") factor, power = energy.quickConversion(wavelength) self.assertAlmostEquals(factor, 9.04456756843) self.assertEquals(power, -0.5)