[pypy-svn] pypy default: Added a test for opening a directory, currently failing.
alex_gaynor
commits-noreply at bitbucket.org
Sat Feb 12 06:18:50 CET 2011
Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch:
Changeset: r41834:51aa0f0e4cf2
Date: 2011-02-12 00:18 -0500
http://bitbucket.org/pypy/pypy/changeset/51aa0f0e4cf2/
Log: Added a test for opening a directory, currently failing.
diff --git a/pypy/module/_file/test/test_file.py b/pypy/module/_file/test/test_file.py
--- a/pypy/module/_file/test/test_file.py
+++ b/pypy/module/_file/test/test_file.py
@@ -198,6 +198,15 @@
assert res == ".,."
f.close()
+ def test_open_dir(self):
+ import os
+
+ exc = raises(IOError, self.file, os.curdir)
+ assert exc.value.filename == os.curdir
+ exc = raises(IOError, self.file, os.curdir, 'w')
+ assert exc.value.filename == os.curdir
+
+
class AppTestConcurrency(object):
# these tests only really make sense on top of a translated pypy-c,
# because on top of py.py the inner calls to os.write() don't
More information about the Pypy-commit
mailing list