summaryrefslogtreecommitdiff
path: root/service/test/support/integration/app_test_client.py
diff options
context:
space:
mode:
Diffstat (limited to 'service/test/support/integration/app_test_client.py')
-rw-r--r--service/test/support/integration/app_test_client.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/service/test/support/integration/app_test_client.py b/service/test/support/integration/app_test_client.py
index 484bea6e..5f7eb90a 100644
--- a/service/test/support/integration/app_test_client.py
+++ b/service/test/support/integration/app_test_client.py
@@ -123,8 +123,9 @@ class AppTestClient(object):
request.args = get_args
return self._render(request, as_json)
- def post(self, path, body=''):
- request = request_mock(path=path, method="POST", body=body, headers={'Content-Type': ['application/json']})
+ def post(self, path, body='', headers=None):
+ headers = headers or {'Content-Type': 'application/json'}
+ request = request_mock(path=path, method="POST", body=body, headers=headers)
return self._render(request)
def put(self, path, body):
@@ -198,6 +199,12 @@ class AppTestClient(object):
res = yield deferred_result
defer.returnValue((res, req))
+ @defer.inlineCallbacks
+ def post_attachment(self, data, headers):
+ deferred_result, req = self.post('/attachment', body=data, headers=headers)
+ res = yield deferred_result
+ defer.returnValue((res, req))
+
def put_mail(self, data):
res, req = self.put('/mails', data)
return res, req