Skip to content

Commit

Permalink
Linting changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
scottwernervt committed Jan 21, 2021
1 parent 3056beb commit 7c17ed1
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,4 @@ Other
0.1 (2017-04-20)
++++++++++++++++

* First release.
* First release.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ recursive-exclude docs *.pyo
recursive-exclude tests *.pyc
recursive-exclude tests *.pyo

prune dist/docs
prune dist/docs
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
2 changes: 1 addition & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.. _changelog:

.. include:: ../CHANGELOG.rst
.. include:: ../CHANGELOG.rst
2 changes: 1 addition & 1 deletion docs/supported.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ Do not see your provider? Create an issue and vote for at `cloudstorage issues
.. _`Minio Cloud Storage`: https://www.minio.io/
.. _`Rackspace CloudFiles`: https://www.rackspace.com/cloud/files
.. _B2TODO: https://github.com/scottwernervt/cloudstorage/issues/2
.. _MSTODO: https://github.com/scottwernervt/cloudstorage/issues/1
.. _MSTODO: https://github.com/scottwernervt/cloudstorage/issues/1
3 changes: 1 addition & 2 deletions src/cloudstorage/drivers/digitalocean.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ def _create_bucket_params(self, params: Dict[Any, Any]) -> Dict[Any, Any]:

@property
def regions(self) -> List[str]:
"""List of DigitalOcean regions that support Spaces.
"""
"""List of DigitalOcean regions that support Spaces."""
return ["nyc3", "ams3", "sfo2", "sgp1", "fra1"]

# noinspection PyUnresolvedReferences
Expand Down
2 changes: 1 addition & 1 deletion src/cloudstorage/drivers/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ def upload_blob(
base_path = os.path.dirname(blob_path)
self._make_path(base_path)

tmp_blob_path = f'{blob_path}.tmp'
tmp_blob_path = f"{blob_path}.tmp"

with lock_local_file(blob_path):
if isinstance(filename, str):
Expand Down
4 changes: 3 additions & 1 deletion src/cloudstorage/drivers/microsoft.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@ def delete_container(self, container: Container) -> None:
def container_cdn_url(self, container: Container) -> str:
azure_container = self._get_azure_container(container.name)
url = "{}://{}/{}".format(
self.service.protocol, self.service.primary_endpoint, azure_container.name,
self.service.protocol,
self.service.primary_endpoint,
azure_container.name,
)
return url

Expand Down
2 changes: 1 addition & 1 deletion src/cloudstorage/drivers/minio.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def __init__(
key: str,
secret: str = None,
region: str = "us-east-1",
**kwargs: Dict
**kwargs: Dict,
) -> None:
secure = kwargs.pop("secure", True)
http_client = kwargs.pop("http_client", None)
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def binary_stream(binary_filename):
@pytest.fixture(scope="function")
def binary_bytes():
f = io.BytesIO()
f.write(b'1' * 1024 * 1024 * 10)
f.write(b"1" * 1024 * 1024 * 10)
f.seek(0)
yield f

Expand Down
2 changes: 1 addition & 1 deletion tests/data/flask.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
The Flask logo is available for download and use in the formats below. You can use the logo to promote Flask like you want. The image is licensed under the “Flask Artwork License”. Read license text.
The Flask logo is available for download and use in the formats below. You can use the logo to promote Flask like you want. The image is licensed under the “Flask Artwork License”. Read license text.
2 changes: 1 addition & 1 deletion tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
TEXT_FILENAME = "flask.txt"
TEXT_STREAM_FILENAME = "flask-stream.txt"
TEXT_FORM_FILENAME = "flask-form.txt"
TEXT_MD5_CHECKSUM = "2a5a634f5c8d931350e83e41c9b3b0bb"
TEXT_MD5_CHECKSUM = "5a9b3669e3a17311e9135fe65e0877a8"

BINARY_FILENAME = "avatar.png"
BINARY_FORM_FILENAME = "avatar-form.png"
Expand Down
9 changes: 3 additions & 6 deletions tests/test_drivers_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,24 +187,21 @@ def test_blob_upload_stream(container, binary_stream):


def test_blob_upload_stream_interrupted(container, binary_bytes):
BLOB_NAME = 'data.bin'
BLOB_NAME = "data.bin"
md5 = hashlib.md5()
md5.update(binary_bytes.getbuffer())
mk5_checksum = md5.hexdigest()

def _upload():
container.upload_blob(
filename=binary_bytes,
blob_name=BLOB_NAME
)
container.upload_blob(filename=binary_bytes, blob_name=BLOB_NAME)

p = mp.Process(target=_upload)
p.start()
time.sleep(0.01)
os.kill(p.pid, 9)
p.join()

bad_blob = container.get_blob(BLOB_NAME + '.tmp')
bad_blob = container.get_blob(BLOB_NAME + ".tmp")
assert bad_blob.checksum != mk5_checksum
bad_blob.delete()

Expand Down

0 comments on commit 7c17ed1

Please sign in to comment.