From f6221a11e3e2daf33cf05de1b290e43779bb4c58 Mon Sep 17 00:00:00 2001 From: Cyril Roelandt Date: Mon, 3 Mar 2014 16:30:14 +0100 Subject: [PATCH] TestResponse: use a default status code The status_code field is compared to integers in the requests library, so it has to be set to an integer, not to None. This works in Python 2 because back then, one could compare an int to NoneType. Partial-Bug: 1287323 Change-Id: I7138ceca36692fdf5948c4d6f74186f89c2709f0 --- openstack_auth/tests/data_v3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openstack_auth/tests/data_v3.py b/openstack_auth/tests/data_v3.py index 023dc7e..7069fd0 100644 --- a/openstack_auth/tests/data_v3.py +++ b/openstack_auth/tests/data_v3.py @@ -39,7 +39,7 @@ class TestResponse(requests.Response): self._text = None super(TestResponse, self) if isinstance(data, dict): - self.status_code = data.get('status_code', None) + self.status_code = data.get('status_code', 200) self.headers = data.get('headers', None) # Fake the text attribute to streamline Response creation self._text = data.get('text', None)