def test_moleculesperm3(self): """ Test the creation of a flux quantity with units of molecules/(m^2*s). """ q = quantity.Flux(1.0, "molecules/(m^2*s)") self.assertAlmostEqual(q.value, 1.0, 6) self.assertAlmostEqual(q.value_si * constants.Na, 1.0, delta=1e-6) self.assertEqual(q.units, "molecules/(m^2*s)")
def test_perm2pers(self): """ Test the creation of a flux quantity with units of m^-2*s^-1. """ try: q = quantity.Flux(1.0, "m^-2*s^-1") self.fail('Allowed invalid unit type "m^-2*s^-1".') except quantity.QuantityError: pass