summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-04-17 10:01:20 -0300
committerdrebs <drebs@leap.se>2017-04-19 11:37:07 +0200
commit27b4510a52431ea8ec9632d6b00358c37867f4d4 (patch)
tree4703c535a50a080a0113e5ca0bf03def89d16a46
parent23a342b3833457e29f01102e18bc22c9c3fb793f (diff)
[tests] dont mock local db on local tests
-rw-r--r--testing/tests/blobs/test_local_backend.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/testing/tests/blobs/test_local_backend.py b/testing/tests/blobs/test_local_backend.py
index 297f0389..5caa7463 100644
--- a/testing/tests/blobs/test_local_backend.py
+++ b/testing/tests/blobs/test_local_backend.py
@@ -107,8 +107,11 @@ class BlobManagerTestCase(unittest.TestCase):
fd = BytesIO('test')
self.manager._encrypt_and_upload = Mock(return_value=None)
self.manager.remote_list = Mock(return_value=[])
- self.manager.local_list = Mock(return_value=['missing_id'])
- self.manager.local = Mock(get=Mock(return_value=fd))
+ yield self.manager.local.put('missing_id', fd, 4)
yield self.manager.send_missing()
- self.manager._encrypt_and_upload.assert_called_with('missing_id', fd)
+ call_list = self.manager._encrypt_and_upload.call_args_list
+ self.assertEquals(1, len(call_list))
+ call_blob_id, call_fd = call_list[0][0]
+ self.assertEquals('missing_id', call_blob_id)
+ self.assertEquals('test', call_fd.getvalue())