# Path: diffoscope/comparators/squashfs.py
# class SquashfsFile(File):
#     CONTAINER_CLASS = SquashfsContainer
#     RE_FILE_TYPE = re.compile(r'^Squashfs filesystem\b')
# 
#     def compare_details(self, other, source=None):
#         return [Difference.from_command(SquashfsSuperblock, self.path, other.path),
#                 Difference.from_command(SquashfsListing, self.path, other.path)]


import pytest
import subprocess
from diffoscope.comparators.squashfs import SquashfsFile
from utils.data import load_fixture, get_data
from utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
from utils.nonexisting import assert_non_existing
# 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/>.





def unsquashfs_version():
    # first line of 'unsquashfs -version' looks like:
    #   unsquashfs version 4.2-git (2013/03/13)
    try:
        out = subprocess.check_output(['unsquashfs', '-version'])
    except subprocess.CalledProcessError as e:
        out = e.output
    return out.decode('UTF-8').splitlines()[0].split()[2].strip()

squashfs1 = load_fixture('test1.squashfs')
squashfs2 = load_fixture('test2.squashfs')

def test_identification(squashfs1):

# Path: diffoscope/comparators/squashfs.py
# class SquashfsFile(File):
#     CONTAINER_CLASS = SquashfsContainer
#     RE_FILE_TYPE = re.compile(r'^Squashfs filesystem\b')
# 
#     def compare_details(self, other, source=None):
#         return [Difference.from_command(SquashfsSuperblock, self.path, other.path),
#                 Difference.from_command(SquashfsListing, self.path, other.path)]


# Path: tests/comparators/test_squashfs.py
import pytest
import subprocess
from diffoscope.comparators.squashfs import SquashfsFile
from utils.data import load_fixture, get_data
from utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
from utils.nonexisting import assert_non_existing

# 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/>.





def unsquashfs_version():
    # first line of 'unsquashfs -version' looks like:
    #   unsquashfs version 4.2-git (2013/03/13)
    try:
        out = subprocess.check_output(['unsquashfs', '-version'])
    except subprocess.CalledProcessError as e:
        out = e.output
    return out.decode('UTF-8').splitlines()[0].split()[2].strip()

squashfs1 = load_fixture('test1.squashfs')
squashfs2 = load_fixture('test2.squashfs')

def test_identification(squashfs1):

    assert isinstance(squashfs1, SquashfsFile)