summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2017-12-09 13:44:29 -0200
committerdrebs <drebs@leap.se>2017-12-13 13:49:28 -0200
commit778ec11d4db7be4ce4b1e2d90a11524b6057a107 (patch)
treeeae53983b33e12348b9d8472d886a4531358384c /tests
parent054a68f474d64713149bf794ddf352224870e975 (diff)
[bug] handle path exceptions using twisted failures
Diffstat (limited to 'tests')
-rw-r--r--tests/blobs/test_fs_backend.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/blobs/test_fs_backend.py b/tests/blobs/test_fs_backend.py
index 28be4835..5b3ff30a 100644
--- a/tests/blobs/test_fs_backend.py
+++ b/tests/blobs/test_fs_backend.py
@@ -142,18 +142,19 @@ class FilesystemBackendTestCase(unittest.TestCase):
target_dir = os.path.join(self.tempdir, 'user', 'incoming')
walk_mock.assert_called_once_with(target_dir)
+ @defer.inlineCallbacks
@pytest.mark.usefixtures("method_tmpdir")
def test_path_validation_on_read_blob(self):
blobs_path, request = self.tempdir, DummyRequest([''])
backend = _blobs.FilesystemBlobsBackend(blobs_path=blobs_path)
with pytest.raises(Exception):
- backend.read_blob('..', '..', request)
+ yield backend.read_blob('..', '..', request)
with pytest.raises(Exception):
- backend.read_blob('user', '../../../', request)
+ yield backend.read_blob('user', '../../../', request)
with pytest.raises(Exception):
- backend.read_blob('../../../', 'blob_id', request)
+ yield backend.read_blob('../../../', 'blob_id', request)
with pytest.raises(Exception):
- backend.read_blob('user', 'blob_id', request, namespace='..')
+ yield backend.read_blob('user', 'blob_id', request, namespace='..')
@pytest.mark.usefixtures("method_tmpdir")
@defer.inlineCallbacks