Skip to content
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

Merged
merged 4 commits into from
Oct 31, 2016
Merged

Add requests transport #66

merged 4 commits into from
Oct 31, 2016

Conversation

theacodes
Copy link
Contributor

No description provided.

@theacodes theacodes added this to the 1.0.0 milestone Oct 31, 2016
@@ -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.

# 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.

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.

@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.

assert http.request.call_args[1]['timeout'] == 5


class MockCredentials(object):

This comment was marked as spam.

This comment was marked as spam.

@@ -10,6 +10,7 @@ deps =
pytest-localserver
urllib3
certifi
requests

This comment was marked as spam.

This comment was marked as spam.

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.

@theacodes theacodes merged commit 9a9ce2c into master Oct 31, 2016
@theacodes theacodes deleted the requests-transport branch October 31, 2016 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants