def METHOD_NAME(self):
    foo = self.path("foo")
    foo_lock = "%s.lock" % foo
    orig_f = open(foo, "rb")
    self.assertEqual(orig_f.read(), b"foo contents")
    orig_f.close()
    self.assertFalse(os.path.exists(foo_lock))
    f = GitFile(foo, "wb")
    self.assertFalse(f.closed)
    self.assertRaises(AttributeError, getattr, f, "not_a_file_property")
    self.assertTrue(os.path.exists(foo_lock))
    f.write(b"new stuff")
    f.seek(4)
    f.write(b"contents")
    f.close()
    self.assertFalse(os.path.exists(foo_lock))
    new_f = open(foo, "rb")
    self.assertEqual(b"new contents", new_f.read())
    new_f.close()