def verify_checksum(self, fn, chk):
        sha = sha1()
        logger.debug(_("checking sha1 of '%s'"), fn)
        f = open(fn, "rb")
        try:
            while 1:
                data = f.read(8192)
                if not data: break
                sha.update(data)
        finally:
            f.close()

        sha = sha.hexdigest()
        if sha != chk:
            os.unlink(fn)
            logger.error(_("file %s has sha1 %s instead of %s"),
                fn, sha, chk)
            raise BadChecksum(_("bad sha1 in downloaded file"))
Check that an album can be deleted using the album object directly
dataset/ETHPy150Open dvarrazzo/pgxnclient/pgxnclient/commands/install.py/Download.verify_checksum--crossover with--dataset/ETHPy150Open photo/openphoto-python/tests/unit/test_albums.py/TestAlbumDelete.test_album_object_delete