summaryrefslogtreecommitdiff
path: root/testing/tests/blobs/test_fs_backend.py
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-05-01 05:17:29 -0300
committerVictor Shyba <victor1984@riseup.net>2017-05-01 05:17:29 -0300
commit313cc19603d787cf40ffe6e5a1feeed2b6226a39 (patch)
tree7b11eb457c423b16defd2cbcc3a92abbf54bf394 /testing/tests/blobs/test_fs_backend.py
parent6ae4b45866a8f4eb85fbde56f2525288afcd300f (diff)
[test] missing inlineCallback
- Related: #8812
Diffstat (limited to 'testing/tests/blobs/test_fs_backend.py')
-rw-r--r--testing/tests/blobs/test_fs_backend.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/testing/tests/blobs/test_fs_backend.py b/testing/tests/blobs/test_fs_backend.py
index 6da22621..39ee0028 100644
--- a/testing/tests/blobs/test_fs_backend.py
+++ b/testing/tests/blobs/test_fs_backend.py
@@ -18,6 +18,7 @@
Tests for blobs backend on server side.
"""
from twisted.trial import unittest
+from twisted.internet import defer
from twisted.web.test.test_web import DummyRequest
from leap.soledad.server import _blobs
from io import BytesIO
@@ -57,17 +58,19 @@ class FilesystemBackendTestCase(unittest.TestCase):
render_mock.render_GET.assert_called_once_with(request)
@mock.patch.object(os.path, 'isfile')
+ @defer.inlineCallbacks
def test_cannot_overwrite(self, isfile):
isfile.return_value = True
backend = _blobs.FilesystemBlobsBackend()
backend._get_path = Mock(return_value='path')
request = DummyRequest([''])
- result = yield backend.write_blob('user', 'blob_id', request)
- self.assertEquals(result, "Blob already exists: blob_id")
+ yield backend.write_blob('user', 'blob_id', request)
+ self.assertEquals(request.written[0], "Blob already exists: blob_id")
self.assertEquals(request.responseCode, 409)
@pytest.mark.usefixtures("method_tmpdir")
@mock.patch.object(os.path, 'isfile')
+ @defer.inlineCallbacks
def test_write_cannot_exceed_quota(self, isfile):
isfile.return_value = False
backend = _blobs.FilesystemBlobsBackend()