Fix check for missing subheadings

If a spec heading is missing entirely, and subheadings are expected,
the heading was being used in a key lookup causing an exception.

Change-Id: I44fb2b9c701cf359433211e876d2f6b3d1dbec5c
This commit is contained in:
Stig Telfer 2015-02-02 03:33:08 +00:00
parent 4a1570061e
commit a12a6527dd
1 changed files with 4 additions and 0 deletions

View File

@ -64,6 +64,10 @@ class TestTitles(testtools.TestCase):
msgs.append("Extra sections: %s" % extra_sections)
for section in expect.keys():
# Sections missing entirely are already covered above
if section not in actual:
continue
missing_subsections = [x for x in expect[section]
if x not in actual[section]]
# extra subsections are allowed