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:
Mark McLoughlin 2012-09-05 22:08:40 +01:00
parent fd893daa47
commit 6bc7055adc
54 changed files with 14 additions and 3 deletions

View File

@ -84,8 +84,8 @@ class ApiSampleTestBase(integrated_helpers._IntegratedTestBase):
return to_dict(etree.fromstring(data))
@classmethod
def _get_sample(cls, name, suffix=''):
parts = [os.path.dirname(os.path.abspath(__file__))]
def _get_sample_path(cls, name, dirname, suffix=''):
parts = [dirname]
parts.append('api_samples')
if cls.all_extensions:
parts.append('all_extensions')
@ -94,8 +94,19 @@ class ApiSampleTestBase(integrated_helpers._IntegratedTestBase):
parts.append(name + "." + cls.ctype + suffix)
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):
template = self._get_sample(name, suffix='.tpl')
template = self._get_template(name)
if self.generate_samples and not os.path.exists(template):
with open(template, 'w') as outf:
pass