Fix the checking of directories for extensions

The test for file extensions was checking everything returned by
glob.glob("guidelines/*"). The recent merge of the refactored HTTP
guidelines added a new guidelines/http/ directory, and the test was
failing because that entry didn't end with either .rst or .json. This
patch corrects that by skipping directories from that name check.

Change-Id: I0a84160015e9c1d96cb456b07c5e45fc6645df08
This commit is contained in:
Ed Leafe 2018-04-12 17:40:40 +00:00
parent f0651255f8
commit e3d4507d10

View File

@ -11,6 +11,7 @@
# under the License. # under the License.
import glob import glob
import os
import re import re
import docutils.core import docutils.core
@ -90,6 +91,8 @@ class TestTitles(testtools.TestCase):
for file in files: for file in files:
if file.endswith('~'): if file.endswith('~'):
continue continue
if os.path.isdir(file):
continue
self.assertTrue( self.assertTrue(
file.endswith(".rst") or file.endswith(".json"), file.endswith(".rst") or file.endswith(".json"),
"guideline file must use 'rst' or 'json'" "guideline file must use 'rst' or 'json'"