Move api_samples to doc dir
The generated api_samples aren't used for the tests, they're only included in git so that they can be synced into the docs. Move them to the doc/ dir to make that more clear since I keep forgetting. Change-Id: I0851ac0ee234dc1e8740666716733e05f856ddec
This commit is contained in:
parent
fd893daa47
commit
6bc7055adc
doc/api_samples
all_extensions
extensions-get-resp.jsonextensions-get-resp.xmlflavor-get-resp.jsonflavor-get-resp.xmlflavors-list-resp.jsonflavors-list-resp.xmlserver-get-resp.jsonserver-get-resp.xmlserver-post-req.jsonserver-post-req.xmlserver-post-resp.jsonserver-post-resp.xml
flavor-get-resp.jsonflavor-get-resp.xmlflavors-list-resp.jsonflavors-list-resp.xmlimage-get-resp.jsonimage-get-resp.xmlimage-meta-key-get.jsonimage-meta-key-get.xmlimage-meta-key-put-req.jsonimage-meta-key-put-req.xmlimage-meta-key-put-resp.jsonimage-meta-key-put-resp.xmlimage-metadata-get-resp.jsonimage-metadata-get-resp.xmlimage-metadata-post-req.jsonimage-metadata-post-req.xmlimage-metadata-post-resp.jsonimage-metadata-post-resp.xmlimage-metadata-put-req.jsonimage-metadata-put-req.xmlimage-metadata-put-resp.jsonimage-metadata-put-resp.xmlimage-metadata-resp.jsonimages-details-get-resp.jsonimages-details-get-resp.xmlimages-details-resp.jsonimages-details-resp.xmlimages-list-get-resp.jsonimages-list-get-resp.xmlimages-list-resp.jsonimages-list-resp.xmllimit-get-resp.jsonlimit-get-resp.xmlserver-get-resp.jsonserver-get-resp.xmlserver-post-req.jsonserver-post-req.xmlserver-post-resp.jsonserver-post-resp.xmlversions-get-resp.jsonversions-get-resp.xmlnova/tests/integrated
0
nova/tests/integrated/api_samples/image-meta-key-get.json → doc/api_samples/image-meta-key-get.json
0
nova/tests/integrated/api_samples/image-meta-key-get.json → doc/api_samples/image-meta-key-get.json
0
nova/tests/integrated/api_samples/images-details-resp.xml → doc/api_samples/images-details-resp.xml
0
nova/tests/integrated/api_samples/images-details-resp.xml → doc/api_samples/images-details-resp.xml
@ -84,8 +84,8 @@ class ApiSampleTestBase(integrated_helpers._IntegratedTestBase):
|
|||||||
return to_dict(etree.fromstring(data))
|
return to_dict(etree.fromstring(data))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _get_sample(cls, name, suffix=''):
|
def _get_sample_path(cls, name, dirname, suffix=''):
|
||||||
parts = [os.path.dirname(os.path.abspath(__file__))]
|
parts = [dirname]
|
||||||
parts.append('api_samples')
|
parts.append('api_samples')
|
||||||
if cls.all_extensions:
|
if cls.all_extensions:
|
||||||
parts.append('all_extensions')
|
parts.append('all_extensions')
|
||||||
@ -94,8 +94,19 @@ class ApiSampleTestBase(integrated_helpers._IntegratedTestBase):
|
|||||||
parts.append(name + "." + cls.ctype + suffix)
|
parts.append(name + "." + cls.ctype + suffix)
|
||||||
return os.path.join(*parts)
|
return os.path.join(*parts)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _get_sample(cls, name):
|
||||||
|
dirname = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
dirname = os.path.join(dirname, "../../../doc")
|
||||||
|
return cls._get_sample_path(name, dirname)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _get_template(cls, name):
|
||||||
|
dirname = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
return cls._get_sample_path(name, dirname, suffix='.tpl')
|
||||||
|
|
||||||
def _read_template(self, name):
|
def _read_template(self, name):
|
||||||
template = self._get_sample(name, suffix='.tpl')
|
template = self._get_template(name)
|
||||||
if self.generate_samples and not os.path.exists(template):
|
if self.generate_samples and not os.path.exists(template):
|
||||||
with open(template, 'w') as outf:
|
with open(template, 'w') as outf:
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user