コード例 #1
0
ファイル: builder.py プロジェクト: ppslim/uplink
 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()
コード例 #2
0
ファイル: builder.py プロジェクト: tehmufifnman/uplink
 def auth(self, auth):
     if auth is not None:
         self._auth = auth_.get_auth(auth)
コード例 #3
0
ファイル: builder.py プロジェクト: tehmufifnman/uplink
 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()
コード例 #4
0
 def test_tuple(self):
     authentication = auth.get_auth(("username", "password"))
     assert isinstance(authentication, auth.BasicAuth)
コード例 #5
0
 def test_unsupported(self):
     with pytest.raises(ValueError):
         auth.get_auth(object())
コード例 #6
0
    def test_callable(self):
        def func():
            None

        output = auth.get_auth(func)
        assert output is func
コード例 #7
0
ファイル: test_auth.py プロジェクト: yyolk/uplink
 def test_none(self):
     authentication = auth.get_auth(None)
     assert authentication == utils.no_op