def test_atomic_file(self): af1 = AtomicFile("tmp.txt") af2 = AtomicFile("tmp.txt") af1.write_atomic(six.b("foo")) af2.write_atomic(six.b("bar")) self.assertEqual(af1.read_atomic(), six.b("bar")) self.assertEqual(af2.read_atomic(), six.b("bar")) local.path("tmp.txt").delete()
def test_atomic_file(self): af1 = AtomicFile("tmp.txt") af2 = AtomicFile("tmp.txt") af1.write_atomic(b"foo") af2.write_atomic(b"bar") assert af1.read_atomic() == b"bar" assert af2.read_atomic() == b"bar" local.path("tmp.txt").delete()