mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
Reviewed by Benjamin Peterson.
This commit is contained in:
parent
ae5360b31e
commit
4c19e6e02d
1 changed files with 7 additions and 0 deletions
|
@ -43,6 +43,13 @@ class FileTests(unittest.TestCase):
|
||||||
os.closerange(first, first + 2)
|
os.closerange(first, first + 2)
|
||||||
self.assertRaises(OSError, os.write, first, "a")
|
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):
|
class TemporaryFileTests(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.files = []
|
self.files = []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue