From 5cf19efa05deb7e157f5e077b27d349606788966 Mon Sep 17 00:00:00 2001 From: Andrew Gorcester Date: Wed, 30 Aug 2023 17:12:41 -0700 Subject: [PATCH] lint --- google/resumable_media/_upload.py | 10 +++------- tests/unit/test__upload.py | 3 +++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/google/resumable_media/_upload.py b/google/resumable_media/_upload.py index c28a339..f102790 100644 --- a/google/resumable_media/_upload.py +++ b/google/resumable_media/_upload.py @@ -933,9 +933,7 @@ def register_part(self, part_number, etag): """ self._parts[part_number] = etag - def _prepare_initiate_request( - self, content_type - ): + def _prepare_initiate_request(self, content_type): """Prepare the contents of HTTP request to initiate upload. This is everything that must be done before a request that doesn't @@ -964,9 +962,7 @@ def _prepare_initiate_request( self._content_type = content_type - initiate_url = ( - self.upload_url + _MPU_INITIATE_QUERY - ) + initiate_url = self.upload_url + _MPU_INITIATE_QUERY return _POST, initiate_url, None, self._headers @@ -1022,7 +1018,7 @@ def initiate( def _prepare_finalize_request(self): """Prepare the contents of an HTTP request to finalize the upload. - + All of the parts must be registered before calling this method. Returns: diff --git a/tests/unit/test__upload.py b/tests/unit/test__upload.py index 7cf352f..aadd71c 100644 --- a/tests/unit/test__upload.py +++ b/tests/unit/test__upload.py @@ -1380,6 +1380,7 @@ def test_xml_mpu_part(filename): part._process_upload_response(response) assert part.etag == ETAG + def test_xml_mpu_part_invalid_response(filename): PART_NUMBER = 1 START = 0 @@ -1401,6 +1402,7 @@ def test_xml_mpu_part_invalid_response(filename): with pytest.raises(common.InvalidResponse): part._process_upload_response(response) + def test_xml_mpu_part_checksum_failure(filename): PART_NUMBER = 1 START = 0 @@ -1425,6 +1427,7 @@ def test_xml_mpu_part_checksum_failure(filename): with pytest.raises(common.DataCorruption): part._process_upload_response(response) + def test_xml_mpu_part_checksum_success(filename): PART_NUMBER = 1 START = 0