Skip to content

Commit c7bc3aa

Browse files
committed
Add unit tests for filtering directories from config include glob match
This commit adds a unit test for commit 54f83ac, checking that only file are matched in a config include glob match.
1 parent 54f83ac commit c7bc3aa

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_config.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,18 @@ def test_multiple_include(self):
189189
self.assertEqual(config.get('AddressFamily'), socket.AF_INET)
190190
self.assertEqual(config.get('Port'), 2222)
191191

192+
def test_glob_with_subdir(self):
193+
"""Test including a glob which matches on a subdirectory"""
194+
195+
os.mkdir('.ssh/config.d')
196+
os.mkdir('.ssh/config.d/subdir')
197+
198+
with open('.ssh/config.d/file', 'w') as f:
199+
f.write('Port 2222\n')
200+
201+
config = self._parse_config('Include config.d/*')
202+
self.assertEqual(config.get('Port'), 2222)
203+
192204
def test_match_all(self):
193205
"""Test a match block which always matches"""
194206

0 commit comments

Comments
 (0)