Merge "Allow new XML API sample file generation"
This commit is contained in:
commit
2ab0bf7431
@ -82,6 +82,9 @@ class ApiSampleTestBase(integrated_helpers._IntegratedTestBase):
|
|||||||
indent=4)
|
indent=4)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
if data is None:
|
||||||
|
# Likely from missing XML file.
|
||||||
|
return ""
|
||||||
xml = etree.XML(data)
|
xml = etree.XML(data)
|
||||||
data = etree.tostring(xml, encoding="UTF-8",
|
data = etree.tostring(xml, encoding="UTF-8",
|
||||||
xml_declaration=True, pretty_print=True)
|
xml_declaration=True, pretty_print=True)
|
||||||
@ -236,7 +239,10 @@ class ApiSampleTestBase(integrated_helpers._IntegratedTestBase):
|
|||||||
with file(self._get_sample(name)) as sample:
|
with file(self._get_sample(name)) as sample:
|
||||||
sample_data = sample.read()
|
sample_data = sample.read()
|
||||||
except IOError:
|
except IOError:
|
||||||
sample_data = "{}"
|
if self.ctype == 'json':
|
||||||
|
sample_data = "{}"
|
||||||
|
else:
|
||||||
|
sample_data = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response_result = self._verify_something(subs, expected,
|
response_result = self._verify_something(subs, expected,
|
||||||
|
Loading…
Reference in New Issue
Block a user