# Path: google/resumable_media/common.py
# _SLEEP_RETRY_ERROR_MSG = (
#     "At most one of `max_cumulative_retry` and `max_retries` " "can be specified."
# )
# UPLOAD_CHUNK_SIZE = 262144  # 256 * 1024
# PERMANENT_REDIRECT = http.client.PERMANENT_REDIRECT  # type: ignore
# TOO_MANY_REQUESTS = http.client.TOO_MANY_REQUESTS
# MAX_SLEEP = 64.0
# MAX_CUMULATIVE_RETRY = 600.0
# RETRYABLE = (
#     http.client.TOO_MANY_REQUESTS,  # 429
#     http.client.REQUEST_TIMEOUT,  # 408
#     http.client.INTERNAL_SERVER_ERROR,  # 500
#     http.client.BAD_GATEWAY,  # 502
#     http.client.SERVICE_UNAVAILABLE,  # 503
#     http.client.GATEWAY_TIMEOUT,  # 504
# )
# class InvalidResponse(Exception):
# class DataCorruption(Exception):
# class RetryStrategy(object):
#     def __init__(self, response, *args):
#     def __init__(self, response, *args):
#     def __init__(
#         self,
#         max_sleep=MAX_SLEEP,
#         max_cumulative_retry=None,
#         max_retries=None,
#         initial_delay=1.0,
#         multiplier=2.0,
#     ):
#     def retry_allowed(self, total_sleep, num_retries):
# 
# Path: google/resumable_media/requests/_request_helpers.py
# _DEFAULT_RETRY_STRATEGY = common.RetryStrategy()
# _SINGLE_GET_CHUNK_SIZE = 8192
# _DEFAULT_CONNECT_TIMEOUT = 61
# _DEFAULT_READ_TIMEOUT = 60
# _CONNECTION_ERROR_CLASSES = (
#     requests.exceptions.ConnectionError,
#     requests.exceptions.ChunkedEncodingError,
#     urllib3.exceptions.ProtocolError,
#     ConnectionError,  # Python 3.x only, superclass of ConnectionResetError.
# )
# class RequestsMixin(object):
# class RawRequestsMixin(RequestsMixin):
#     def _get_status_code(response):
#     def _get_headers(response):
#     def _get_body(response):
#     def _get_body(response):
# def wait_and_retry(func, get_status_code, retry_strategy):


import http.client
import mock
import pytest  # type: ignore
import requests.exceptions
import urllib3.exceptions  # type: ignore
from google.resumable_media import common
from google.resumable_media.requests import _request_helpers
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.





EXPECTED_TIMEOUT = (61, 60)


class TestRequestsMixin(object):
    def test__get_status_code(self):
        status_code = int(http.client.OK)
        response = _make_response(status_code)

# Path: google/resumable_media/common.py
# _SLEEP_RETRY_ERROR_MSG = (
#     "At most one of `max_cumulative_retry` and `max_retries` " "can be specified."
# )
# UPLOAD_CHUNK_SIZE = 262144  # 256 * 1024
# PERMANENT_REDIRECT = http.client.PERMANENT_REDIRECT  # type: ignore
# TOO_MANY_REQUESTS = http.client.TOO_MANY_REQUESTS
# MAX_SLEEP = 64.0
# MAX_CUMULATIVE_RETRY = 600.0
# RETRYABLE = (
#     http.client.TOO_MANY_REQUESTS,  # 429
#     http.client.REQUEST_TIMEOUT,  # 408
#     http.client.INTERNAL_SERVER_ERROR,  # 500
#     http.client.BAD_GATEWAY,  # 502
#     http.client.SERVICE_UNAVAILABLE,  # 503
#     http.client.GATEWAY_TIMEOUT,  # 504
# )
# class InvalidResponse(Exception):
# class DataCorruption(Exception):
# class RetryStrategy(object):
#     def __init__(self, response, *args):
#     def __init__(self, response, *args):
#     def __init__(
#         self,
#         max_sleep=MAX_SLEEP,
#         max_cumulative_retry=None,
#         max_retries=None,
#         initial_delay=1.0,
#         multiplier=2.0,
#     ):
#     def retry_allowed(self, total_sleep, num_retries):
# 
# Path: google/resumable_media/requests/_request_helpers.py
# _DEFAULT_RETRY_STRATEGY = common.RetryStrategy()
# _SINGLE_GET_CHUNK_SIZE = 8192
# _DEFAULT_CONNECT_TIMEOUT = 61
# _DEFAULT_READ_TIMEOUT = 60
# _CONNECTION_ERROR_CLASSES = (
#     requests.exceptions.ConnectionError,
#     requests.exceptions.ChunkedEncodingError,
#     urllib3.exceptions.ProtocolError,
#     ConnectionError,  # Python 3.x only, superclass of ConnectionResetError.
# )
# class RequestsMixin(object):
# class RawRequestsMixin(RequestsMixin):
#     def _get_status_code(response):
#     def _get_headers(response):
#     def _get_body(response):
#     def _get_body(response):
# def wait_and_retry(func, get_status_code, retry_strategy):


# Path: tests/unit/requests/test__helpers.py
import http.client
import mock
import pytest  # type: ignore
import requests.exceptions
import urllib3.exceptions  # type: ignore
from google.resumable_media import common
from google.resumable_media.requests import _request_helpers

# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.





EXPECTED_TIMEOUT = (61, 60)


class TestRequestsMixin(object):
    def test__get_status_code(self):
        status_code = int(http.client.OK)
        response = _make_response(status_code)

        assert status_code == _request_helpers.RequestsMixin._get_status_code(response)