summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_posix.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2010-07-23 12:16:41 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2010-07-23 12:16:41 (GMT)
commitc9e1c7d97f97a4aa18b984bb62dedaf6bb5aa251 (patch)
treea221da32da6cec2c5e088e1b56586f3cf6304a79 /Lib/test/test_posix.py
parente186e384f4fb11158b448d94f37aaf2a3ed6b45e (diff)
downloadcpython-c9e1c7d97f97a4aa18b984bb62dedaf6bb5aa251.zip
cpython-c9e1c7d97f97a4aa18b984bb62dedaf6bb5aa251.tar.gz
cpython-c9e1c7d97f97a4aa18b984bb62dedaf6bb5aa251.tar.bz2
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.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index cbc786c..ab78ab6 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'):