def test_get_method_invalid(): """Errors out with invalid argument""" s = Session() with pytest.raises(ArgumentTypeErr) as exc: s.get_method(opt.MonCar) assert str(exc.value) == "'name' must be a string"
def test_set_method(name, req): """We can set the method""" s = Session() s.set_method(name) ans = s.get_method() assert isinstance(ans, req)
def test_get_method_named(name, req): """get_method returns requested instance""" s = Session() method = s.get_method(name) assert isinstance(method, req)
def test_get_method_default(): """get_method returns default instance (LevMar)""" s = Session() method = s.get_method() assert isinstance(method, opt.LevMar)