def test_add_user_pars_modelname_not_a_model1(): s = Session() with pytest.raises(ArgumentTypeErr) as exc: s.add_user_pars('not a model', ['x']) assert str(exc.value) == "'not a model' must be a user model"
def test_add_user_pars_modelname_not_a_string(): s = Session() with pytest.raises(ArgumentTypeErr) as exc: s.add_user_pars(23, ['x']) assert str(exc.value) == "'model name' must be a string"
def test_add_user_pars_modelname_not_a_model2(): """Use an actual model, but not a user model""" s = Session() s._add_model_types(sherpa.models.basic) s.create_model_component('scale1d', 'foo') with pytest.raises(ArgumentTypeErr) as exc: s.add_user_pars('foo', ['x']) assert str(exc.value) == "'foo' must be a user model"