From e3d4507d101a8c16ee2b6c7bdec9aa1cc2405f5c Mon Sep 17 00:00:00 2001 From: Ed Leafe Date: Thu, 12 Apr 2018 17:40:40 +0000 Subject: [PATCH] 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 --- tests/test_titles.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_titles.py b/tests/test_titles.py index 669d7b9..84702c4 100644 --- a/tests/test_titles.py +++ b/tests/test_titles.py @@ -11,6 +11,7 @@ # under the License. import glob +import os import re import docutils.core @@ -90,6 +91,8 @@ class TestTitles(testtools.TestCase): for file in files: if file.endswith('~'): continue + if os.path.isdir(file): + continue self.assertTrue( file.endswith(".rst") or file.endswith(".json"), "guideline file must use 'rst' or 'json'"