diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2010-07-23 12:16:41 +0000 |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2010-07-23 12:16:41 +0000 |
commit | c9e1c7d97f97a4aa18b984bb62dedaf6bb5aa251 (patch) | |
tree | a221da32da6cec2c5e088e1b56586f3cf6304a79 /Lib/test/test_posix.py | |
parent | e186e384f4fb11158b448d94f37aaf2a3ed6b45e (diff) | |
download | cpython-git-c9e1c7d97f97a4aa18b984bb62dedaf6bb5aa251.tar.gz |
Issue #6095: Make directory argument to os.listdir optional.
Patch by Virgil Dupras.
Diffstat (limited to 'Lib/test/test_posix.py')
-rw-r--r-- | Lib/test/test_posix.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index cbc786cdc0..ab78ab6c78 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -252,9 +252,14 @@ class PosixTester(unittest.TestCase): posix.chdir(os.curdir) self.assertRaises(OSError, posix.chdir, support.TESTFN) - def test_lsdir(self): - if hasattr(posix, 'lsdir'): - self.assertIn(support.TESTFN, posix.lsdir(os.curdir)) + def test_listdir(self): + if hasattr(posix, 'listdir'): + self.assertTrue(support.TESTFN in posix.listdir(os.curdir)) + + def test_listdir_default(self): + # When listdir is called without argument, it's the same as listdir(os.curdir) + if hasattr(posix, 'listdir'): + self.assertTrue(support.TESTFN in posix.listdir()) def test_access(self): if hasattr(posix, 'access'): |