Skip to content

Commit

Permalink
fix(lint): blacken 5 files (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
crwilcox committed Sep 10, 2020
1 parent 0902df1 commit cdea3ee
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
2 changes: 1 addition & 1 deletion google/resumable_media/_download.py
Expand Up @@ -530,7 +530,7 @@ def get_range_info(response, get_headers, callback=_helpers.do_nothing):


def _check_for_zero_content_range(response, get_status_code, get_headers):
""" Validate if response status code is 416 and content range is zero.
"""Validate if response status code is 416 and content range is zero.
This is the special case for handling zero bytes files.
Expand Down
8 changes: 6 additions & 2 deletions google/resumable_media/_helpers.py
Expand Up @@ -182,7 +182,7 @@ def wait_and_retry(func, get_status_code, retry_strategy):


def _get_crc32c_object():
""" Get crc32c object
"""Get crc32c object
Attempt to use the Google-CRC32c package. If it isn't available, try
to use CRCMod. CRCMod might be using a 'slow' varietal. If so, warn...
"""
Expand All @@ -206,7 +206,11 @@ def _get_crc32c_object():
def _is_fast_crcmod():
# Determine if this is using the slow form of crcmod.
nested_crcmod = __import__(
"crcmod.crcmod", globals(), locals(), ["_usingExtension"], 0,
"crcmod.crcmod",
globals(),
locals(),
["_usingExtension"],
0,
)
fast_crc = getattr(nested_crcmod, "_usingExtension", False)
if not fast_crc:
Expand Down
6 changes: 5 additions & 1 deletion tests/unit/requests/test_download.py
Expand Up @@ -622,7 +622,11 @@ def test_consume_next_chunk_with_custom_timeout(self):
range_bytes = u"bytes={:d}-{:d}".format(start, start + chunk_size - 1)
download_headers = {u"range": range_bytes}
transport.request.assert_called_once_with(
u"GET", EXAMPLE_URL, data=None, headers=download_headers, timeout=14.7,
u"GET",
EXAMPLE_URL,
data=None,
headers=download_headers,
timeout=14.7,
)


Expand Down
13 changes: 11 additions & 2 deletions tests/unit/requests/test_upload.py
Expand Up @@ -73,7 +73,11 @@ def test_transmit_w_custom_timeout(self):

expected_headers = {u"content-type": content_type}
transport.request.assert_called_once_with(
u"POST", SIMPLE_URL, data=data, headers=expected_headers, timeout=12.6,
u"POST",
SIMPLE_URL,
data=data,
headers=expected_headers,
timeout=12.6,
)


Expand Down Expand Up @@ -209,7 +213,12 @@ def test_initiate_w_custom_timeout(self):
transport.request.return_value = post_response

upload.initiate(
transport, stream, metadata, BASIC_CONTENT, total_bytes=100, timeout=12.6,
transport,
stream,
metadata,
BASIC_CONTENT,
total_bytes=100,
timeout=12.6,
)

# Make sure timeout was passed to the transport
Expand Down
6 changes: 5 additions & 1 deletion tests/unit/test__helpers.py
Expand Up @@ -430,4 +430,8 @@ def test_md5_multiple_matches(self):


def _mock_response(headers):
return mock.Mock(headers=headers, status_code=200, spec=["status_code", "headers"],)
return mock.Mock(
headers=headers,
status_code=200,
spec=["status_code", "headers"],
)

0 comments on commit cdea3ee

Please sign in to comment.