Move title length check after name check

Don't check the number of titles in the spec until
after the individual sections are checked for. This
makes it easier to find which section is missing
by having an assertIn failure for the name instead
of an assertEqual failure on the length.

Change-Id: I0761c0a2f70d53c7be204ef76d7256902f900caa
This commit is contained in:
Kevin Benton 2014-07-10 22:12:43 -07:00
parent d3b266eb21
commit c645491454
1 changed files with 2 additions and 2 deletions

View File

@ -52,8 +52,6 @@ class TestTitles(testtools.TestCase):
return titles
def _check_titles(self, titles):
self.assertEqual(7, len(titles))
problem = 'Problem description'
self.assertIn(problem, titles)
self.assertEqual(0, len(titles[problem]))
@ -92,6 +90,8 @@ class TestTitles(testtools.TestCase):
self.assertIn(refs, titles)
self.assertEqual(0, len(titles[refs]))
self.assertEqual(7, len(titles))
def test_template(self):
files = glob.glob('specs/*.rst') + glob.glob('specs/*/*')
for filename in files: