def test_request_headers(patch_base_class): stream = StravaStream() inputs = { "stream_slice": None, "stream_state": None, "next_page_token": None } expected_headers = {} assert stream.request_headers(**inputs) == expected_headers
def test_backoff_time(patch_base_class): response_mock = MagicMock() stream = StravaStream() expected_backoff_time = None assert stream.backoff_time(response_mock) == expected_backoff_time
def test_should_retry(patch_base_class, http_status, should_retry): response_mock = MagicMock() response_mock.status_code = http_status stream = StravaStream() assert stream.should_retry(response_mock) == should_retry
def test_http_method(patch_base_class): stream = StravaStream() expected_method = "GET" assert stream.http_method == expected_method
def test_next_page_token(patch_base_class): stream = StravaStream() inputs = {"response": MagicMock()} expected_token = None assert stream.next_page_token(**inputs) == expected_token