Add test to check that error messages from ctml_writer are propagated
This commit is contained in:
parent
bc0346eae7
commit
9cddf5aaed
2 changed files with 14 additions and 0 deletions
|
|
@ -324,3 +324,11 @@ class CtmlConverterTest(utilities.CanteraTest):
|
|||
def test_pdep(self):
|
||||
gas = ct.Solution('../data/pdep-test.cti')
|
||||
self.assertEqual(gas.n_reactions, 6)
|
||||
|
||||
def test_invalid(self):
|
||||
try:
|
||||
gas = ct.Solution('../data/invalid.cti')
|
||||
except RuntimeError as e:
|
||||
err = e
|
||||
|
||||
self.assertIn('Multiply-declared species', err.args[0])
|
||||
|
|
|
|||
6
test/data/invalid.cti
Normal file
6
test/data/invalid.cti
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
ideal_gas(
|
||||
name="complete",
|
||||
elements=" C H O",
|
||||
species="gri30: O2 CH4 H2O CO2 CH4",
|
||||
initial_state=state(temperature=298.0,
|
||||
pressure = 100000.0))
|
||||
Loading…
Add table
Reference in a new issue