From 778ec11d4db7be4ce4b1e2d90a11524b6057a107 Mon Sep 17 00:00:00 2001 From: drebs Date: Sat, 9 Dec 2017 13:44:29 -0200 Subject: [bug] handle path exceptions using twisted failures --- tests/blobs/test_fs_backend.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tests') 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 -- cgit v1.2.3