-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add requests transport #66
Conversation
@@ -366,7 +366,8 @@ | |||
# Example configuration for intersphinx: refer to the Python standard library. | |||
intersphinx_mapping = { | |||
'python': ('https://docs.python.org/3.5', None), | |||
'urllib3': ('https://urllib3.readthedocs.io/en/latest', None), | |||
'urllib3': ('https://urllib3.readthedocs.io/en/stable', None), | |||
'requests': ('http://docs.python-requests.org/en/stable', None), |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
"""Transport adapter for Requests.""" |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
HTTP = urllib3.PoolManager(retries=False) | ||
URLLIB3_HTTP = urllib3.PoolManager(retries=False) | ||
REQUESTS_SESSION = requests.Session() | ||
REQUESTS_SESSION.verify = False |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@pytest.fixture | ||
def http_request(): | ||
@pytest.fixture(params=['urllib3', 'requests']) | ||
def http_request(request): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
assert http.request.call_args[1]['timeout'] == 5 | ||
|
||
|
||
class MockCredentials(object): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -10,6 +10,7 @@ deps = | |||
pytest-localserver | |||
urllib3 | |||
certifi | |||
requests |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
assert mock_credentials.before_request.called | ||
assert not mock_credentials.refresh.called | ||
assert mock_adapter.requests[0].url == self.TEST_URL | ||
assert mock_adapter.requests[0].headers['authorization'] == 'token' |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
No description provided.