Mercurial > hg > AtomicWrite
diff tests/test_atomicwrite.py @ 1:a4188f41ca35 default tip
basically the thing
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Fri, 02 Jan 2015 13:22:09 -0800 |
parents | dc90512b9c98 |
children |
line wrap: on
line diff
--- a/tests/test_atomicwrite.py Fri Jan 02 13:08:39 2015 -0800 +++ b/tests/test_atomicwrite.py Fri Jan 02 13:22:09 2015 -0800 @@ -4,8 +4,8 @@ unit tests for AtomicWrite """ +import atomic import os -import sys import tempfile import unittest @@ -14,6 +14,9 @@ def test_atomicwrite(self): tf = tempfile.mktemp() self.assertFalse(os.path.exists(tf)) + atomic.write('foo', tf) + self.assertTrue(os.path.exists(tf)) + self.assertEqual(open(tf, 'r').read(), 'foo') if __name__ == '__main__': unittest.main()