summaryrefslogtreecommitdiff
path: root/testing/tests/server
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-07-25 04:36:04 -0300
committerVictor Shyba <victor1984@riseup.net>2017-08-03 05:33:01 -0300
commit639d86626b8e519a966578b48b77c68f7076be35 (patch)
tree5d59b3fdb3b2251e35fa5d1655396623cba9be37 /testing/tests/server
parent2e490bf0887bbbd440497111981d7cb48bb6dae6 (diff)
[bug] flag as PENDING during incoming creation
Clients will query for blobs flagged PENDING so they can start processing. This commit adds flagging, but still in a hacky way as the backend requires the flags as a json string inside a request. A refactor to separate request handling from the backend itself will solve it in the near future. -- Related: #8874
Diffstat (limited to 'testing/tests/server')
-rw-r--r--testing/tests/server/test_incoming_server.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/testing/tests/server/test_incoming_server.py b/testing/tests/server/test_incoming_server.py
index 8886a721..55eb8931 100644
--- a/testing/tests/server/test_incoming_server.py
+++ b/testing/tests/server/test_incoming_server.py
@@ -18,6 +18,7 @@
Integration tests for incoming API
"""
import pytest
+import json
from io import BytesIO
from uuid import uuid4
from twisted.web.test.test_web import DummyRequest
@@ -30,6 +31,7 @@ from leap.soledad.server._incoming import IncomingResource
from leap.soledad.server._blobs import BlobsServerState
from leap.soledad.server._incoming import IncomingFormatter
from leap.soledad.common.crypto import EncryptionSchemes
+from leap.soledad.common.blobs import Flags
from test_soledad.util import CouchServerStateForTests
from test_soledad.util import CouchDBTestCase
@@ -83,5 +85,8 @@ class IncomingOnCouchServerTestCase(CouchDBTestCase):
db = self.state.open_database(user_id)
request = DummyRequest([user_id, doc_id])
yield db.read_blob(user_id, doc_id, request, 'MX')
+ flags = db.get_flags(user_id, doc_id, request, 'MX')
+ flags = json.loads(flags)
expected = formatter.preamble(content, doc_id) + content
self.assertEquals(expected, request.written[0])
+ self.assertIn(Flags.PENDING, flags)