summaryrefslogtreecommitdiff
path: root/Lib/distutils
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-09-19 17:32:51 +0200
committerJason R. Coombs <jaraco@jaraco.com>2015-09-19 17:32:51 +0200
commita2cf2292a221f874bfec7587299ef26baee08906 (patch)
tree2428b10b4c80cb0f435f9f4fb7451d7b46409dfe /Lib/distutils
parent2c5278ad30c2883a9d64e834d38119bb96487396 (diff)
downloadcpython-git-a2cf2292a221f874bfec7587299ef26baee08906.tar.gz
Add docstring and additional test revealing nuances of the implementation as found in setuptools.
Diffstat (limited to 'Lib/distutils')
-rw-r--r--Lib/distutils/tests/test_filelist.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/distutils/tests/test_filelist.py b/Lib/distutils/tests/test_filelist.py
index 45ff565373..571acdbc08 100644
--- a/Lib/distutils/tests/test_filelist.py
+++ b/Lib/distutils/tests/test_filelist.py
@@ -302,6 +302,11 @@ class FindAllTestCase(unittest.TestCase):
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 @@ class FindAllTestCase(unittest.TestCase):
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()