[pypy-svn] r31425 - in pypy/dist/pypy/module/posix: . test
rhymes at codespeak.net
rhymes at codespeak.net
Mon Aug 21 00:03:54 CEST 2006
Author: rhymes
Date: Mon Aug 21 00:03:50 2006
New Revision: 31425
Modified:
pypy/dist/pypy/module/posix/__init__.py
pypy/dist/pypy/module/posix/test/test_posix2.py
Log:
test linking and a small fix
Modified: pypy/dist/pypy/module/posix/__init__.py
==============================================================================
--- pypy/dist/pypy/module/posix/__init__.py (original)
+++ pypy/dist/pypy/module/posix/__init__.py Mon Aug 21 00:03:50 2006
@@ -49,8 +49,8 @@
'access' : 'interp_posix.access',
}
- for func_name in ['ftruncate', 'putenv', 'unsetenv', 'getpid', 'link'
- 'symlink', 'readlink', 'fork', 'fork', 'waitpid', 'chown', 'chroot',
+ for func_name in ['ftruncate', 'putenv', 'unsetenv', 'getpid', 'link',
+ 'symlink', 'readlink', 'fork', 'waitpid', 'chown', 'chroot',
'confstr', 'ctermid', 'fchdir', 'fpathconf', 'getegid', 'geteuid',
'getgid', 'getuid', 'getpgid', 'getpid', 'getppid', 'getpgrp',
'getsid', 'getlogin', 'getgroups', 'getloadavg']:
Modified: pypy/dist/pypy/module/posix/test/test_posix2.py
==============================================================================
--- pypy/dist/pypy/module/posix/test/test_posix2.py (original)
+++ pypy/dist/pypy/module/posix/test/test_posix2.py Mon Aug 21 00:03:50 2006
@@ -86,6 +86,8 @@
ex(self.posix.fchdir, UNUSEDFD)
ex(self.posix.getpgid, UNUSEDFD)
ex(self.posix.getsid, UNUSEDFD)
+ ex(self.posix.link, "foo", "foo")
+ ex(self.posix.readlink, "foo")
def test_fdopen(self):
path = self.path
@@ -321,6 +323,18 @@
load = posix.getloadavg()
assert isinstance(load, tuple)
assert len(load) == 3
+
+ def test_linking(self):
+ import os
+ if hasattr(__import__(os.name), "symlink"):
+ posix = self.posix
+ pdir = self.pdir
+ path = self.path
+ link = os.path.join(pdir, 'link')
+ posix.symlink(path, link)
+ hard_link = os.path.join(pdir, 'hard_link')
+ posix.link(path, hard_link)
+ assert posix.readlink(link) == path
class AppTestEnvironment(object):
def setup_class(cls):
More information about the Pypy-commit
mailing list