# Path: diffoscope/comparators/image.py
# class ICOImageFile(File):
#     RE_FILE_TYPE = re.compile(r'\bMS Windows icon resource\b')
# 
#     def compare_details(self, other, source=None):
#         differences = []
# 
#         # img2txt does not support .ico files directly so convert to .PNG.
#         try:
#             png_a, png_b = [ICOImageFile.convert(x) for x in (self, other)]
#         except subprocess.CalledProcessError:  # noqa
#             pass
#         else:
#             differences.append(Difference.from_command(Img2Txt, png_a, png_b))
# 
#         differences.append(Difference.from_command(
#             Identify,
#             self.path,
#             other.path,
#             source="Image metadata",
#         ))
# 
#         return differences
# 
#     @staticmethod
#     @tool_required('convert')
#     def convert(file):
#         result = get_named_temporary_file(suffix='.png').name
# 
#         subprocess.check_call(('convert', file.path, result))
# 
#         return result


import pytest
from diffoscope.comparators.image import ICOImageFile
from utils.data import load_fixture, get_data
from utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
from test_jpeg_image import identify_version
# diffoscope is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# diffoscope is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.





image1 = load_fixture('test1.ico')
image2 = load_fixture('test2.ico')
image1_meta = load_fixture('test1_meta.ico')
image2_meta = load_fixture('test2_meta.ico')

def test_identification(image1):
    assert isinstance(image1, ICOImageFile)

def test_no_differences(image1):
    difference = image1.compare(image1)
    assert difference is None

@pytest.fixture

# Path: diffoscope/comparators/image.py
# class ICOImageFile(File):
#     RE_FILE_TYPE = re.compile(r'\bMS Windows icon resource\b')
# 
#     def compare_details(self, other, source=None):
#         differences = []
# 
#         # img2txt does not support .ico files directly so convert to .PNG.
#         try:
#             png_a, png_b = [ICOImageFile.convert(x) for x in (self, other)]
#         except subprocess.CalledProcessError:  # noqa
#             pass
#         else:
#             differences.append(Difference.from_command(Img2Txt, png_a, png_b))
# 
#         differences.append(Difference.from_command(
#             Identify,
#             self.path,
#             other.path,
#             source="Image metadata",
#         ))
# 
#         return differences
# 
#     @staticmethod
#     @tool_required('convert')
#     def convert(file):
#         result = get_named_temporary_file(suffix='.png').name
# 
#         subprocess.check_call(('convert', file.path, result))
# 
#         return result


# Path: tests/comparators/test_ico_image.py
import pytest
from diffoscope.comparators.image import ICOImageFile
from utils.data import load_fixture, get_data
from utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
from test_jpeg_image import identify_version

# diffoscope is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# diffoscope is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.





image1 = load_fixture('test1.ico')
image2 = load_fixture('test2.ico')
image1_meta = load_fixture('test1_meta.ico')
image2_meta = load_fixture('test2_meta.ico')

def test_identification(image1):
    assert isinstance(image1, ICOImageFile)

def test_no_differences(image1):
    difference = image1.compare(image1)
    assert difference is None

@pytest.fixture

def differences(image1, image2):