diff options
| author | NavaL <mnandri@thoughtworks.com> | 2016-01-25 20:47:27 +0100 | 
|---|---|---|
| committer | NavaL <mnandri@thoughtworks.com> | 2016-01-25 20:47:52 +0100 | 
| commit | bb16581d63d1de23a5dc5457e0030802b9fd00d7 (patch) | |
| tree | d8e8adb2d6d76881c62a7fd5f374447995512608 /service/test/support/test_helper.py | |
| parent | a542199a90aefdcee010db02134c40a1aaf6e919 (diff) | |
added integration test
Issue #576
Diffstat (limited to 'service/test/support/test_helper.py')
| -rw-r--r-- | service/test/support/test_helper.py | 11 | 
1 files changed, 10 insertions, 1 deletions
| diff --git a/service/test/support/test_helper.py b/service/test/support/test_helper.py index 703b62fa..77c74407 100644 --- a/service/test/support/test_helper.py +++ b/service/test/support/test_helper.py @@ -93,11 +93,20 @@ class PixRequestMock(DummyRequest):          if len(self.written):              return self.written[0] +    def redirect(self, url): +        self.setResponseCode(302) +        self.setHeader(b"location", url) +  def request_mock(path='', method='GET', body='', headers={}):      dummy = PixRequestMock(path.split('/'))      for name, val in headers.iteritems():          dummy.headers[name.lower()] = val      dummy.method = method -    dummy.content = io.BytesIO(body) +    if isinstance(body, str): +        dummy.content = io.BytesIO(body) +    else: +        for key, val in body.items(): +            dummy.addArg(key, val) +      return dummy | 
