Esempio n. 1
0
 def test_moleculesperm3(self):
     """
     Test the creation of an concentration quantity with units of molecules/m^3.
     """
     q = quantity.Concentration(1.0, "molecules/m^3")
     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^3")
Esempio n. 2
0
 def test_perm3(self):
     """
     Test the creation of an concentration quantity with units of m^-3.
     """
     try:
         q = quantity.Concentration(1.0, "m^-3")
         self.fail('Allowed invalid unit type "m^-3".')
     except quantity.QuantityError:
         pass