]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Mock the rename failure a bit better
authorAntoine Pitrou <solipsis@pitrou.net>
Mon, 2 Jan 2012 18:18:02 +0000 (19:18 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Mon, 2 Jan 2012 18:18:02 +0000 (19:18 +0100)
Lib/test/test_shutil.py

index a2002369aa2925bb710fb105d0d3fd0c6f2ec899..a750166fac296ed735e6f1883a162d4e567e0ce2 100644 (file)
@@ -7,6 +7,7 @@ import sys
 import stat
 import os
 import os.path
+import errno
 import functools
 from test import support
 from test.support import TESTFN
@@ -46,7 +47,7 @@ except ImportError:
 
 def _fake_rename(*args, **kwargs):
     # Pretend the destination path is on a different filesystem.
-    raise OSError()
+    raise OSError(getattr(errno, 'EXDEV', 18), "Invalid cross-device link")
 
 def mock_rename(func):
     @functools.wraps(func)