summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_os.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index e9b0652..50b5831 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -43,6 +43,13 @@ class FileTests(unittest.TestCase):
os.closerange(first, first + 2)
self.assertRaises(OSError, os.write, first, "a")
+ def test_rename(self):
+ path = 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):
self.files = []