diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2015-09-19 17:32:51 +0200 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-09-19 17:32:51 +0200 |
commit | e54077ba1964fbb59f3f1df7b9290694a4dc964d (patch) | |
tree | 90ed07208d362d355e9379ab063a17ab95c724bf | |
parent | 3bf3f37dd03a1978f6c8386dd348f681241494a8 (diff) | |
download | python-setuptools-git-e54077ba1964fbb59f3f1df7b9290694a4dc964d.tar.gz |
Add docstring and additional test revealing nuances of the implementation as found in setuptools.
-rw-r--r-- | tests/test_filelist.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_filelist.py b/tests/test_filelist.py index 45ff5653..571acdbc 100644 --- a/tests/test_filelist.py +++ b/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() |