def __init__(self): self._base_url = "" self._hooks = [] self._client = clients.get_client() self._converters = collections.deque() self._converters.append(converters.StandardConverter()) self._auth = auth_.get_auth()
def auth(self, auth): if auth is not None: self._auth = auth_.get_auth(auth)
def __init__(self): self._base_url = "" self._hooks = [] self._client = clients.get_client() self._converters = converters_.get_default_converter_factories() self._auth = auth_.get_auth()
def test_tuple(self): authentication = auth.get_auth(("username", "password")) assert isinstance(authentication, auth.BasicAuth)
def test_unsupported(self): with pytest.raises(ValueError): auth.get_auth(object())
def test_callable(self): def func(): None output = auth.get_auth(func) assert output is func
def test_none(self): authentication = auth.get_auth(None) assert authentication == utils.no_op