Skip to content

Commit a2cf229

Browse files
committed
Add docstring and additional test revealing nuances of the implementation as found in setuptools.
1 parent 2c5278a commit a2cf229

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Lib/distutils/tests/test_filelist.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,11 @@ def test_missing_symlink(self):
302302
self.assertEqual(filelist.findall(), [])
303303

304304
def test_basic_discovery(self):
305+
"""
306+
When findall is called with no parameters or with
307+
'.' as the parameter, the dot should be omitted from
308+
the results.
309+
"""
305310
with test.support.temp_cwd():
306311
os.mkdir('foo')
307312
file1 = os.path.join('foo', 'file1.txt')
@@ -312,6 +317,17 @@ def test_basic_discovery(self):
312317
expected = [file1, file2]
313318
self.assertEqual(filelist.findall(), expected)
314319

320+
def test_non_local_discovery(self):
321+
"""
322+
When findall is called with another path, the full
323+
path name should be returned.
324+
"""
325+
with test.support.temp_dir() as temp_dir:
326+
file1 = os.path.join(temp_dir, 'file1.txt')
327+
test.support.create_empty_file(file1)
328+
expected = [file1]
329+
self.assertEqual(filelist.findall(temp_dir), expected)
330+
315331

316332
if __name__ == "__main__":
317333
unittest.main()

0 commit comments

Comments
 (0)