diff options
author | Victor Shyba <victor1984@riseup.net> | 2017-07-20 04:31:40 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2017-07-21 10:58:48 -0300 |
commit | 961e43404e0d23674360860b04ba5480e752cc94 (patch) | |
tree | 575403ebb74f9823df925b1ef166a5d7ac4723c4 /testing/tests/server | |
parent | 76cbf4cbf0876e06d1d8e2839b63dffc13c271dd (diff) |
[refactor] error handling and missing headers
Improves error handling, add missing header to __init__.py and remove
mkdirs from flags methods. This is a commit from code review on !117.
Diffstat (limited to 'testing/tests/server')
-rw-r--r-- | testing/tests/server/test_blobs_server.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/testing/tests/server/test_blobs_server.py b/testing/tests/server/test_blobs_server.py index dde25668..152215d1 100644 --- a/testing/tests/server/test_blobs_server.py +++ b/testing/tests/server/test_blobs_server.py @@ -31,6 +31,7 @@ from leap.soledad.server import _blobs as server_blobs from leap.soledad.client._db.blobs import BlobManager from leap.soledad.client._db.blobs import BlobAlreadyExistsError from leap.soledad.client._db.blobs import InvalidFlagsError +from leap.soledad.client._db.blobs import SoledadError class BlobServerTestCase(unittest.TestCase): @@ -70,6 +71,14 @@ class BlobServerTestCase(unittest.TestCase): @defer.inlineCallbacks @pytest.mark.usefixtures("method_tmpdir") + def test_set_flags_raises_if_no_blob_found(self): + manager = BlobManager('', self.uri, self.secret, + self.secret, 'user') + with pytest.raises(SoledadError): + yield manager.set_flags('missing_id', [Flags.PENDING]) + + @defer.inlineCallbacks + @pytest.mark.usefixtures("method_tmpdir") def test_list_filter_flag(self): manager = BlobManager('', self.uri, self.secret, self.secret, 'user') |