[Python-checkins] cpython (3.4): Add docstring and additional test revealing nuances of the implementation as
jason.coombs
python-checkins at python.org
Thu Sep 1 21:17:07 EDT 2016
https://hg.python.org/cpython/rev/c2892a7ad148
changeset: 102993:c2892a7ad148
branch: 3.4
user: Jason R. Coombs <jaraco at jaraco.com>
date: Sat Sep 19 17:32:51 2015 +0200
summary:
Add docstring and additional test revealing nuances of the implementation as found in setuptools.
files:
Lib/distutils/tests/test_filelist.py | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/Lib/distutils/tests/test_filelist.py b/Lib/distutils/tests/test_filelist.py
--- a/Lib/distutils/tests/test_filelist.py
+++ b/Lib/distutils/tests/test_filelist.py
@@ -302,6 +302,11 @@
self.assertEqual(filelist.findall(), [])
def test_basic_discovery(self):
+ """
+ When findall is called with no parameters or with
+ '.' as the parameter, the dot should be omitted from
+ the results.
+ """
with test.support.temp_cwd():
os.mkdir('foo')
file1 = os.path.join('foo', 'file1.txt')
@@ -312,6 +317,17 @@
expected = [file1, file2]
self.assertEqual(filelist.findall(), expected)
+ def test_non_local_discovery(self):
+ """
+ When findall is called with another path, the full
+ path name should be returned.
+ """
+ with test.support.temp_dir() as temp_dir:
+ file1 = os.path.join(temp_dir, 'file1.txt')
+ test.support.create_empty_file(file1)
+ expected = [file1]
+ self.assertEqual(filelist.findall(temp_dir), expected)
+
if __name__ == "__main__":
unittest.main()
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list