[Cython/Reactor] Raise exception for unrecognized keyword arguments

This commit is contained in:
Ray Speth 2014-09-23 02:20:53 +00:00
parent ab6ae72e0d
commit f14cd6d471
2 changed files with 7 additions and 2 deletions

View file

@ -12,7 +12,7 @@ cdef class ReactorBase:
self.rbase = newReactor(stringify(self.reactor_type))
# The signature of this function causes warnings for Sphinx documentation
def __init__(self, ThermoPhase contents=None, name=None, **kwargs):
def __init__(self, ThermoPhase contents=None, name=None):
self._inlets = []
self._outlets = []
self._walls = []

View file

@ -520,6 +520,11 @@ class TestReactor(utilities.CanteraTest):
with self.assertRaises(AttributeError):
x.foobar
def test_bad_kwarg(self):
self.reactorClass(name='ok')
with self.assertRaises(TypeError):
r1 = self.reactorClass(foobar=3.14)
class TestIdealGasReactor(TestReactor):
reactorClass = ct.IdealGasReactor
@ -1165,7 +1170,7 @@ class CombustorTestImplementation(object):
# create the combustor, and fill it in initially with a diluent
self.gas.TPX = 300.0, ct.one_atm, 'AR:1.0'
self.combustor = ct.IdealGasReactor(self.gas, volume=1.0)
self.combustor = ct.IdealGasReactor(self.gas)
# create a reservoir for the exhaust
self.exhaust = ct.Reservoir(self.gas)