summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dent <chdent@redhat.com>2015-03-30 16:58:46 +0000
committerChris Dent <chdent@redhat.com>2015-03-30 16:58:46 +0000
commit3405824823161e9ea5ce4474b6e701bda369bdb4 (patch)
tree9db0d95672d1066521f8d86e51c66496689f95c4
parentc8243a90c46ec321e596ded8d1b7b122f2b478ad (diff)
downloadceilometer-3405824823161e9ea5ce4474b6e701bda369bdb4.tar.gz
Avoid a error when py27 and py-mysql tests run in sequence
An imcompletely MagicMock can lead to: File "ceilometer/network/statistics/opencontrail/client.py", line 107, in _log_res LOG.debug(''.join(dump)) TypeError: sequence item 3: expected string, MagicMock found When the py-mysql tox test target is run after the py27 target. This happens because the Mock is not sufficiently formed for the places where it gets used. The "dump" above needs to have a value for 'reason'. Change-Id: I36fd406a06958e795ecf9aa9ff933eddaa979fc8 Closes-Bug: #1438300
-rw-r--r--ceilometer/tests/network/statistics/opencontrail/test_client.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/ceilometer/tests/network/statistics/opencontrail/test_client.py b/ceilometer/tests/network/statistics/opencontrail/test_client.py
index f1b71642..521fb1c2 100644
--- a/ceilometer/tests/network/statistics/opencontrail/test_client.py
+++ b/ceilometer/tests/network/statistics/opencontrail/test_client.py
@@ -29,6 +29,7 @@ class TestOpencontrailClient(base.BaseTestCase):
return_value=self.get_resp).start()
self.get_resp.raw_version = 1.1
self.get_resp.status_code = 200
+ self.get_resp.reason = 'OK'
def test_vm_statistics(self):
self.client.networks.get_vm_statistics('bbb')