summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-12-19 02:11:57 +0000
committerGerrit Code Review <review@openstack.org>2012-12-19 02:11:57 +0000
commit1d864329c6c5320bde0cd30e3b39f2f93bbe9196 (patch)
tree858dce7c88f6a9245a8d264a0a6e73a478c30058
parentcb9e57321111e1ff4a0e91abcb46c38f107d4bab (diff)
parent2e01dc0673006892e3b559b372a26ff9205d7c81 (diff)
downloadnova-1d864329c6c5320bde0cd30e3b39f2f93bbe9196.tar.gz
nova-1d864329c6c5320bde0cd30e3b39f2f93bbe9196.tar.xz
nova-1d864329c6c5320bde0cd30e3b39f2f93bbe9196.zip
Merge "Fix API samples generation."
-rw-r--r--nova/tests/integrated/test_api_samples.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/nova/tests/integrated/test_api_samples.py b/nova/tests/integrated/test_api_samples.py
index 49ff77306..46cf408f1 100644
--- a/nova/tests/integrated/test_api_samples.py
+++ b/nova/tests/integrated/test_api_samples.py
@@ -228,9 +228,12 @@ class ApiSampleTestBase(integrated_helpers._IntegratedTestBase):
def _verify_response(self, name, subs, response):
expected = self._read_template(name)
expected = self._objectify(expected)
- with file(self._get_sample(name)) as sample:
- sample_data = sample.read()
response_data = response.read()
+ try:
+ with file(self._get_sample(name)) as sample:
+ sample_data = sample.read()
+ except IOError:
+ sample_data = "{}"
try:
response_result = self._verify_something(subs, expected,