summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/blobs/test_blob_manager.py45
1 files changed, 0 insertions, 45 deletions
diff --git a/tests/blobs/test_blob_manager.py b/tests/blobs/test_blob_manager.py
index 4b2b1135..f1872ab1 100644
--- a/tests/blobs/test_blob_manager.py
+++ b/tests/blobs/test_blob_manager.py
@@ -23,7 +23,6 @@ from leap.soledad.client._document import BlobDoc
from leap.soledad.client._db.blobs import BlobManager, FIXED_REV
from leap.soledad.client._db.blobs import BlobAlreadyExistsError
from leap.soledad.client._db.blobs import SyncStatus
-from leap.soledad.client._db.blobs import RetriableTransferError
from io import BytesIO
from mock import Mock
from uuid import uuid4
@@ -169,50 +168,6 @@ class BlobManagerTestCase(unittest.TestCase):
@defer.inlineCallbacks
@pytest.mark.usefixtures("method_tmpdir")
- def test_upload_retry_limit(self):
- # prepare the manager to fail accordingly
- self.manager.remote_list = Mock(return_value=[])
- self.manager._encrypt_and_upload = Mock(
- side_effect=RetriableTransferError)
- # put a blob in local storage
- content, blob_id = "Blob content", uuid4().hex
- yield self.manager.local.put(blob_id, BytesIO(content), len(content))
- pending = SyncStatus.PENDING_UPLOAD
- yield self.manager.local.update_sync_status(blob_id, pending)
- # try to send missing
- with pytest.raises(defer.FirstError):
- yield self.manager.send_missing()
- # assert failed state and number of retries
- failed_upload = SyncStatus.FAILED_UPLOAD
- local_list = yield self.manager.local_list_status(failed_upload)
- self.assertIn(blob_id, local_list)
- sync_status, retries = \
- yield self.manager.local.get_sync_status(blob_id)
- self.assertEqual(failed_upload, sync_status)
- self.assertEqual(self.manager.max_retries, retries)
-
- @defer.inlineCallbacks
- @pytest.mark.usefixtures("method_tmpdir")
- def test_download_retry_limit(self):
- # prepare the manager to fail accordingly
- blob_id = uuid4().hex
- self.manager.local_list_status = Mock(return_value=[blob_id])
- self.manager._download_and_decrypt = Mock(
- side_effect=RetriableTransferError)
- # try to fetch missing
- with pytest.raises(defer.FirstError):
- yield self.manager.fetch_missing()
- # assert failed state and number of retries
- failed_download = SyncStatus.FAILED_DOWNLOAD
- local_list = yield self.manager.local.list_status(failed_download)
- self.assertIn(blob_id, local_list)
- sync_status, retries = \
- yield self.manager.local.get_sync_status(blob_id)
- self.assertEqual(failed_download, sync_status)
- self.assertEqual(self.manager.max_retries, retries)
-
- @defer.inlineCallbacks
- @pytest.mark.usefixtures("method_tmpdir")
def test_local_list_doesnt_include_unavailable_blobs(self):
local = self.manager.local
unavailable_ids, deferreds = [], []