def METHOD_NAME(barerepo):
    data = "bazbarfoo"
    handle, tempfile_path = tempfile.mkstemp()
    with os.fdopen(handle, 'w') as fh:
        fh.write(data)
    hashed_sha1 = pygit2.hashfile(tempfile_path)
    Path(tempfile_path).unlink()
    written_sha1 = barerepo.create_blob(data)
    assert hashed_sha1 == written_sha1