How to use the diffoscope.difference.Difference.from_text_readers function in diffoscope

To help you get started, we’ve selected a few diffoscope examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github anthraxx / diffoscope / tests / test_difference.py View on Github external
def test_non_str_arguments_to_source1_source2():
    for x in (
        (None, 'str'),
        ('str', None),
    ):
        a = io.StringIO('a')
        b = io.StringIO('b')

        with pytest.raises(TypeError):
            Difference.from_text_readers(a, b, *x)
github anthraxx / diffoscope / diffoscope / comparators / symlink.py View on Github external
def compare(self, other, source=None):
        with open(self.path) as my_content, \
             open(other.path) as other_content:
            return Difference.from_text_readers(my_content, other_content, self.name, other.name, source=source, comment="symlink")
github anthraxx / diffoscope / diffoscope / comparators / cpio.py View on Github external
def compare_details(self, other, source=None):
        return [Difference.from_text_readers(
            list_libarchive(self.path),
            list_libarchive(other.path),
            self.path,
            other.path,
            source="file list",
        )]
github anthraxx / diffoscope / diffoscope / comparators / elf.py View on Github external
def compare_details(self, other, source=None):
        differences = [Difference.from_text_readers(
            list_libarchive(self.path),
            list_libarchive(other.path),
            self.path,
            other.path,
            source="file list",
        )]
        differences.extend(_compare_elf_data(self.path, other.path))
        return differences
github anthraxx / diffoscope / diffoscope / comparators / deb.py View on Github external
def compare_details(self, other, source=None):
        return [Difference.from_text_readers(list_libarchive(self.path),
                                        list_libarchive(other.path),
                                        self.path, other.path, source="file list")]
github anthraxx / diffoscope / diffoscope / comparators / device.py View on Github external
def compare(self, other, source=None):
        with open(self.path) as my_content, \
             open(other.path) as other_content:
            return Difference.from_text_readers(my_content, other_content, self.name, other.name, source=source, comment="device")