[Base] add unit test probing methods of C++ SolutionBase

This commit is contained in:
Ingmar Schoegl 2019-08-16 09:33:15 -05:00 committed by Ray Speth
parent afd36b1c1e
commit 486e2ba9b8

View file

@ -13,6 +13,15 @@ class TestThermoPhase(utilities.CanteraTest):
def setUp(self):
self.phase = ct.Solution('h2o2.xml')
def test_cpp_attributes(self):
self.assertTrue(isinstance(self.phase.type, str))
self.assertTrue(self.phase.type=='Solution')
self.assertTrue(isinstance(self.phase.unique_name, str))
self.phase.unique_name = 'spam'
self.assertTrue(self.phase.unique_name=='spam')
with self.assertRaises(AttributeError):
self.phase.type = 'eggs'
def test_phases(self):
self.assertEqual(self.phase.n_phases, 1)