예제 #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
 def auth(self, auth):
     if auth is not None:
         self._auth = auth_.get_auth(auth)
예제 #3
0
 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