diff options
author | mnandri <mnandri@eunglick.corporate.thoughtworks.com> | 2015-12-16 16:35:33 +0100 |
---|---|---|
committer | mnandri <mnandri@eunglick.corporate.thoughtworks.com> | 2015-12-18 11:22:34 +0100 |
commit | 338498cef1cd4f2b9ae49bc54bd496de0e5472a0 (patch) | |
tree | c64272dc1f7bb8502974f6993cda33b157f31cf2 /service/test/support/integration/app_test_client.py | |
parent | f8ac23150f5f840eaa4ef920b003966f911de8fa (diff) |
WIP: rename me later
Diffstat (limited to 'service/test/support/integration/app_test_client.py')
-rw-r--r-- | service/test/support/integration/app_test_client.py | 11 |
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 |