# 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):


import mock
import pytest  # type: ignore
from google.resumable_media import common
        retry_strategy = common.RetryStrategy(initial_delay=3.0, multiplier=4)
        assert retry_strategy.max_sleep == common.MAX_SLEEP
        assert retry_strategy.max_cumulative_retry == common.MAX_CUMULATIVE_RETRY
        assert retry_strategy.max_retries is None
        assert retry_strategy.initial_delay == 3.0
        assert retry_strategy.multiplier == 4

    def test_constructor_explicit_bound_cumulative(self):
        max_sleep = 10.0
        max_cumulative_retry = 100.0
        retry_strategy = common.RetryStrategy(
            max_sleep=max_sleep, max_cumulative_retry=max_cumulative_retry
        )

        assert retry_strategy.max_sleep == max_sleep
        assert retry_strategy.max_cumulative_retry == max_cumulative_retry
        assert retry_strategy.max_retries is None

    def test_constructor_explicit_bound_retries(self):
        max_sleep = 13.75
        max_retries = 14
        retry_strategy = common.RetryStrategy(
            max_sleep=max_sleep, max_retries=max_retries
        )

        assert retry_strategy.max_sleep == max_sleep
        assert retry_strategy.max_cumulative_retry is None
        assert retry_strategy.max_retries == max_retries

    def test_retry_allowed_bound_cumulative(self):

# 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: tests/unit/test_common.py
import mock
import pytest  # type: ignore
from google.resumable_media import common

        retry_strategy = common.RetryStrategy(initial_delay=3.0, multiplier=4)
        assert retry_strategy.max_sleep == common.MAX_SLEEP
        assert retry_strategy.max_cumulative_retry == common.MAX_CUMULATIVE_RETRY
        assert retry_strategy.max_retries is None
        assert retry_strategy.initial_delay == 3.0
        assert retry_strategy.multiplier == 4

    def test_constructor_explicit_bound_cumulative(self):
        max_sleep = 10.0
        max_cumulative_retry = 100.0
        retry_strategy = common.RetryStrategy(
            max_sleep=max_sleep, max_cumulative_retry=max_cumulative_retry
        )

        assert retry_strategy.max_sleep == max_sleep
        assert retry_strategy.max_cumulative_retry == max_cumulative_retry
        assert retry_strategy.max_retries is None

    def test_constructor_explicit_bound_retries(self):
        max_sleep = 13.75
        max_retries = 14
        retry_strategy = common.RetryStrategy(
            max_sleep=max_sleep, max_retries=max_retries
        )

        assert retry_strategy.max_sleep == max_sleep
        assert retry_strategy.max_cumulative_retry is None
        assert retry_strategy.max_retries == max_retries

    def test_retry_allowed_bound_cumulative(self):

        retry_strategy = common.RetryStrategy(max_cumulative_retry=100.0)