FakeResponse: use a default status code

When running some tests from test_restapi.py, the following error happens:

    TypeError: unorderable types: NoneType() < int()

In Python 2, comparing NoneType and integers is possible:

    >>> None < 2
    True

But in Python 3, it's not allowed. Fix this by using a default status code.

Change-Id: Ic0fad5c68f3bf2dd8a2b98423549903f982192c9
This commit is contained in:
Cyril Roelandt 2014-02-11 17:31:37 +01:00
parent 380d78c856
commit 9dc3eb5b18

View File

@ -55,7 +55,7 @@ fake_headers = {
class FakeResponse(requests.Response):
def __init__(self, headers={}, status_code=None, data=None, encoding=None):
def __init__(self, headers={}, status_code=200, data=None, encoding=None):
super(FakeResponse, self).__init__()
self.status_code = status_code