summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2017-12-09 13:58:11 -0200
committerdrebs <drebs@leap.se>2017-12-13 13:49:28 -0200
commitcc480a2e6c11856759a5297e94a0ff128d0a1593 (patch)
tree48355aad56919ca6110c1fac14a9bf1a131439a1 /tests
parent778ec11d4db7be4ce4b1e2d90a11524b6057a107 (diff)
[test] fix incoming test with the new async blobs backend
Diffstat (limited to 'tests')
-rw-r--r--tests/server/test_incoming_server.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/server/test_incoming_server.py b/tests/server/test_incoming_server.py
index d5127077..f278be74 100644
--- a/tests/server/test_incoming_server.py
+++ b/tests/server/test_incoming_server.py
@@ -20,7 +20,6 @@ Integration tests for incoming API
import pytest
from io import BytesIO
from uuid import uuid4
-from twisted.web.test.test_web import DummyRequest
from twisted.web.server import Site
from twisted.internet import reactor
from twisted.internet import defer
@@ -83,13 +82,12 @@ class IncomingOnCouchServerTestCase(CouchDBTestCase):
yield treq.put(incoming_endpoint, BytesIO(content), persistent=False)
db = self.state.open_database(user_id)
- request = DummyRequest([user_id, doc_id])
- res = db.read_blob(user_id, doc_id, namespace='MX')
- yield res.render_GET(request)
- flags = db.get_flags(user_id, doc_id, namespace='MX')
+ fd = yield db.read_blob(user_id, doc_id, namespace='MX')
+ flags = yield db.get_flags(user_id, doc_id, namespace='MX')
+ data = fd.read()
expected_preamble = formatter.preamble(content, doc_id)
expected_preamble = decode_preamble(expected_preamble, True)
- written_preamble, written_content = request.written[0].split()
+ written_preamble, written_content = data.split()
written_preamble = decode_preamble(written_preamble, True)
self.assertEquals(expected_preamble, written_preamble)
self.assertEquals(content, written_content)