diff --git a/src/pcloud/api.py b/src/pcloud/api.py index d802d51..2a2f9b7 100644 --- a/src/pcloud/api.py +++ b/src/pcloud/api.py @@ -132,7 +132,9 @@ def uploadfile(self, **kwargs): files = {filename: open(f, "rb")} # kwargs['filename'] = filename else: # 'data' in kwargs: - files = {"f": (kwargs.pop("filename", "data-upload.bin"), kwargs.pop("data"))} + files = { + "f": (kwargs.pop("filename", "data-upload.bin"), kwargs.pop("data")) + } return self._upload("uploadfile", files, **kwargs) @RequiredParameterCheck(("progresshash",)) @@ -218,7 +220,7 @@ def file_truncate(self, **kwargs): @RequiredParameterCheck(("fd", "data")) def file_write(self, **kwargs): - files = {"file": ('upload-file.io', BytesIO(kwargs.pop("data")))} + files = {"file": ("upload-file.io", BytesIO(kwargs.pop("data")))} return self._upload("file_write", files, **kwargs) @RequiredParameterCheck(("fd",)) diff --git a/src/pcloud/tests/conftest.py b/src/pcloud/tests/conftest.py index f668966..2fe5dab 100644 --- a/src/pcloud/tests/conftest.py +++ b/src/pcloud/tests/conftest.py @@ -20,4 +20,3 @@ def start_mock_server(): httpd_thread.join(1) httpd_thread._is_stopped = True httpd_thread._tstate_lock = None - diff --git a/src/pcloud/tests/server.py b/src/pcloud/tests/server.py index 0747732..0c898e5 100644 --- a/src/pcloud/tests/server.py +++ b/src/pcloud/tests/server.py @@ -37,7 +37,7 @@ def do_POST(self): self.send_response(200) self.send_header("Content-type", "applicaton/json") self.end_headers() - print(f"File: {file_}, Size: {size}", end='') + print(f"File: {file_}, Size: {size}", end="") # Send the json message self.wfile.write( bytes('{ "result": 0, "metadata": {"size": %s} }' % size, "utf-8") diff --git a/src/pcloud/tests/test_api.py b/src/pcloud/tests/test_api.py index 39869b2..6fbe9ad 100644 --- a/src/pcloud/tests/test_api.py +++ b/src/pcloud/tests/test_api.py @@ -18,7 +18,6 @@ class DummyPCloudFS(PCloudFS): @pytest.mark.usefixtures("start_mock_server") class TestPcloudApi(object): - def test_getdigest(self): api = DummyPyCloud("foo", "bar") assert api.getdigest() == b"YGtAxbUpI85Zvs7lC7Z62rBwv907TBXhV2L867Hkh" @@ -38,7 +37,6 @@ def test_upload_files(self): @pytest.mark.usefixtures("start_mock_server") class TestPcloudFs(object): - def test_write(self, capsys): with DummyPCloudFS(username="foo", password="bar") as fs: data = b"hello pcloud fs unittest" @@ -46,4 +44,3 @@ def test_write(self, capsys): fs_f.write(data) captured = capsys.readouterr() assert captured.out == "File: b'hello pcloud fs unittest', Size: 24" -