summaryrefslogtreecommitdiff
path: root/tests/blobs
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-10-31 06:15:06 -0300
committerVictor Shyba <victor1984@riseup.net>2017-10-31 06:15:06 -0300
commitc8234da89b198064f1d1f14bec6811c0883e705c (patch)
tree78fbf8fbb0ca149897acf2cfb6c5b4c753cd9cf5 /tests/blobs
parent72956174187fa2fccbb060d04d4809797657e029 (diff)
[feature] add sync progress attribute
--Resolves: #8848
Diffstat (limited to 'tests/blobs')
-rw-r--r--tests/blobs/test_blob_manager.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/blobs/test_blob_manager.py b/tests/blobs/test_blob_manager.py
index f1872ab1..d36b3cda 100644
--- a/tests/blobs/test_blob_manager.py
+++ b/tests/blobs/test_blob_manager.py
@@ -128,6 +128,22 @@ class BlobManagerTestCase(unittest.TestCase):
@defer.inlineCallbacks
@pytest.mark.usefixtures("method_tmpdir")
+ def test_sync_progress(self):
+ deferreds = []
+ local = self.manager.local
+ pending_download = SyncStatus.PENDING_DOWNLOAD
+ pending_upload = SyncStatus.PENDING_UPLOAD
+ synced = SyncStatus.SYNCED
+ for status in [pending_download, pending_upload, synced, synced]:
+ deferreds.append(local.update_sync_status(uuid4().hex, status))
+ yield defer.gatherResults(deferreds)
+
+ progress = yield self.manager.sync_progress
+ self.assertEquals(progress, {
+ 'PENDING_DOWNLOAD': 1, 'PENDING_UPLOAD': 1, 'SYNCED': 2})
+
+ @defer.inlineCallbacks
+ @pytest.mark.usefixtures("method_tmpdir")
def test_duplicated_blob_error_on_put(self):
self.manager._encrypt_and_upload = Mock(return_value=None)
content, existing_id = "Blob content", uuid4().hex