def test_Parameters_check_extra(self): p = Parameters(xyz=10, **self.vals) self.assertRaises(Exception, lambda: p.check()) p = Parameters(strict=False, xyz=10, **self.vals) p.check() # should not raise
def test_Parameters_check(self): p = Parameters(**self.vals) p.check() # should not raise
def test_Parameters_check_missing(self): p = Parameters() self.assertRaises(Exception, lambda: p.check()) p = Parameters(strict=False) p.check() # should not raise
def test_Parameters_invalid_KeyError(self): """even if the value is present, if it's not a valid property, raise KeyError""" p = Parameters(xyz=10, strict=True, **self.vals) self.assertRaises(Exception, lambda: p.check())