First pass at fix for bug #1604187

There are differences between requestslib's PreparedRequest and
Syntribos' RequestObject, which can cause problems when they are used
inconsistently.

This is a first pass at a fix, editing BaseTestCase's send_init_request
to add the body to the test.init_req object.

Change-Id: I6f71fb52bca2f1cccdbdbce5f081431a0750db66
Partial-Bug: #1604187
This commit is contained in:
Charles Neill 2016-07-18 18:30:19 -05:00
parent 48f1295d5c
commit 3a9e6b62d0
1 changed files with 6 additions and 2 deletions

View File

@ -125,8 +125,12 @@ class BaseTestCase(unittest.TestCase):
prepared_copy = request_obj.get_prepared_copy()
cls.init_resp, cls.init_signals = cls.client.send_request(
prepared_copy)
cls.init_req = request_obj
if cls.init_resp is None:
cls.init_req = prepared_copy
if cls.init_resp is not None:
# Get the computed body and add it to our RequestObject
# TODO(cneill): Figure out a better way to handle this discrepancy
cls.init_req.body = cls.init_resp.request.body
else:
cls.dead = True
@classmethod