예제 #1
0
 def test_kcalpermolperK(self):
     """
     Test the creation of a heat capacity quantity with units of kcal/(mol*K).
     """
     q = quantity.HeatCapacity(1.0, "kcal/(mol*K)")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si, 4184., delta=1e-6)
     self.assertEqual(q.units, "kcal/(mol*K)")
예제 #2
0
 def test_kj_per_mol_kelvin(self):
     """
     Test the creation of a heat capacity quantity with units of kJ/(mol*K).
     """
     q = quantity.HeatCapacity(1.0, "kJ/(mol*K)")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si, 1000., delta=1e-6)
     self.assertEqual(q.units, "kJ/(mol*K)")
예제 #3
0
 def test_kcalperK(self):
     """
     Test the creation of a heat capacity quantity with units of kcal/K.
     """
     try:
         q = quantity.HeatCapacity(1.0, "kcal/K")
         self.fail('Allowed invalid unit type "kcal/K".')
     except quantity.QuantityError:
         pass
예제 #4
0
 def test_cal_per_kelvin(self):
     """
     Test the creation of a heat capacity quantity with units of cal/K.
     """
     try:
         quantity.HeatCapacity(1.0, "cal/K")
         self.fail('Allowed invalid unit type "cal/K".')
     except quantity.QuantityError:
         pass