From 308334d6a483b3f2cd0a02837f9af2b141d46c30 Mon Sep 17 00:00:00 2001 From: Hirokazu Yamamoto Date: Mon, 8 Sep 2008 23:10:08 +0000 Subject: [PATCH] Issue #3804: Added test for Issue #2222. Reviewed by Benjamin Peterson. --- Lib/test/test_os.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 26c5482b307..741224c6fc9 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -23,6 +23,13 @@ class FileTests(unittest.TestCase): os.close(f) self.assert_(os.access(test_support.TESTFN, os.W_OK)) + def test_rename(self): + path = unicode(test_support.TESTFN) + old = sys.getrefcount(path) + self.assertRaises(TypeError, os.rename, path, 0) + new = sys.getrefcount(path) + self.assertEqual(old, new) + class TemporaryFileTests(unittest.TestCase): def setUp(self):