Merge "Add assertion to ensure the file extension"

This commit is contained in:
Jenkins
2014-04-11 09:28:12 +00:00
committed by Gerrit Code Review

View File

@@ -80,8 +80,10 @@ class TestTitles(testtools.TestCase):
self.assertEqual(0, len(titles[refs]))
def test_template(self):
files = ['specs/template.rst'] + glob.glob('specs/*/*.rst')
files = ['specs/template.rst'] + glob.glob('specs/*/*')
for filename in files:
self.assertTrue(filename.endswith(".rst"),
"spec's file must uses 'rst' extension.")
with open(filename) as f:
data = f.read()
spec = docutils.core.publish_doctree(data)