def METHOD_NAME(self, uf2block, expected_chip_id):
    flags = mkuf2.UF2Writer.UF2_FLAG_FAMILYID_PRESENT | mkuf2.UF2Writer.UF2_FLAG_MD5_PRESENT
    parsed_binaries = []
    block_list = []  # collect block numbers here
    total_blocks = set()  # collect total block numbers here
    for block in UF2BlockReader(uf2block).get():
        if block.blockNo == 0:
            # new file has been detected
            base_addr = block.targetAddr
            current_addr = base_addr
            binary_writer = BinaryWriter(self.generate_binary(0))
        self.assertEqual(len(block), mkuf2.UF2Writer.UF2_BLOCK_SIZE)
        self.assertEqual(block.magicStart0, mkuf2.UF2Writer.UF2_FIRST_MAGIC)
        self.assertEqual(block.magicStart1, mkuf2.UF2Writer.UF2_SECOND_MAGIC)
        self.assertEqual(block.flags & flags, flags)
        self.assertEqual(len(block.data), mkuf2.UF2Writer.UF2_DATA_SIZE)
        payload = block.data[:block.payloadSize]
        md5_obj = hashlib.md5(payload)
        md5_part = block.data[block.payloadSize:block.payloadSize + mkuf2.UF2Writer.UF2_MD5_PART_SIZE]
        address, length = struct.unpack('<II', md5_part[:-md5_obj.digest_size])
        md5sum = md5_part[-md5_obj.digest_size:]
        self.assertEqual(address, block.targetAddr)
        self.assertEqual(length, block.payloadSize)
        self.assertEqual(md5sum, md5_obj.digest())
        self.assertEqual(block.familyID, expected_chip_id)
        self.assertEqual(block.magicEnd, mkuf2.UF2Writer.UF2_FINAL_MAGIC)
        self.assertEqual(current_addr, block.targetAddr)
        binary_writer.append(payload)
        block_list.append(block.blockNo)
        total_blocks.add(block.numBlocks)
        if block.blockNo == block.numBlocks - 1:
            self.assertEqual(block_list, list(range(block.numBlocks)))
            # we have found all blocks and in the right order
            self.assertEqual(total_blocks, {block.numBlocks})  # numBlocks are the same in all the blocks
            del block_list[:]
            total_blocks.clear()
            parsed_binaries += [(base_addr, binary_writer.f_name)]
        current_addr += block.payloadSize
    return parsed_binaries