From aa856846d846b3c6b334af757df7dd826b902219 Mon Sep 17 00:00:00 2001 From: Rayan Date: Wed, 7 Apr 2021 11:01:59 -0400 Subject: [PATCH] Added a test for ignoring subdirectories --- pelican/tests/test_generators.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index 169765ac..5ad30d0b 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -31,9 +31,16 @@ class TestGenerator(unittest.TestCase): def test_include_path(self): self.settings['IGNORE_FILES'] = {'ignored1.rst', 'ignored2.rst'} + self.settings['IGNORE_SUBDIRS'] = {'/sub', '/subone'} + + subdir = os.path.join(CUR_DIR, '/sub', 'atest.txt') + include_dir = self.generator._include_path + self.assertFalse(include_dir(subdir)) + filename = os.path.join(CUR_DIR, 'content', 'article.rst') include_path = self.generator._include_path + self.assertTrue(include_path(filename)) self.assertTrue(include_path(filename, extensions=('rst',))) self.assertFalse(include_path(filename, extensions=('md',)))