--- a/tests/test-atomictempfile.py Wed Aug 24 05:42:41 2011 -0400
+++ b/tests/test-atomictempfile.py Thu Aug 25 20:21:04 2011 -0400
@@ -12,22 +12,21 @@
assert basename in glob.glob('.foo-*')
file.write('argh\n')
- file.rename()
+ file.close()
assert os.path.isfile('foo')
assert basename not in glob.glob('.foo-*')
print 'OK'
-# close() removes the temp file but does not make the write
-# permanent -- essentially discards your work (WTF?!)
-def test2_close():
+# discard() removes the temp file without making the write permanent
+def test2_discard():
if os.path.exists('foo'):
os.remove('foo')
file = atomictempfile('foo')
(dir, basename) = os.path.split(file._tempname)
file.write('yo\n')
- file.close()
+ file.discard()
assert not os.path.isfile('foo')
assert basename not in os.listdir('.')
@@ -45,5 +44,5 @@
if __name__ == '__main__':
test1_simple()
- test2_close()
+ test2_discard()
test3_oops()