[diffoscope] 03/04: Rename NonExisting -> Missing.
Chris Lamb
chris at chris-lamb.co.uk
Tue Dec 27 18:16:46 CET 2016
This is an automated email from the git hooks/post-receive script.
lamby pushed a commit to branch master
in repository diffoscope.
commit a61325157db0598a47aa6a09405225a7bcfa53f9
Author: Chris Lamb <lamby at debian.org>
Date: Tue Dec 27 17:15:43 2016 +0000
Rename NonExisting -> Missing.
Signed-off-by: Chris Lamb <lamby at debian.org>
---
diffoscope/comparators/__init__.py | 4 ++--
diffoscope/comparators/binary.py | 4 ++--
diffoscope/comparators/utils/__init__.py | 26 +++++++++++++-------------
diffoscope/comparators/utils/compare.py | 6 +++---
tests/comparators/test_binary.py | 8 ++++----
tests/comparators/test_deb.py | 4 ++--
tests/comparators/test_debian.py | 6 +++---
tests/comparators/test_dex.py | 4 ++--
tests/comparators/test_elf.py | 6 +++---
tests/comparators/test_epub.py | 4 ++--
tests/comparators/test_fonts.py | 4 ++--
tests/comparators/test_fsimage.py | 4 ++--
tests/comparators/test_gettext.py | 4 ++--
tests/comparators/test_gzip.py | 4 ++--
tests/comparators/test_icc.py | 4 ++--
tests/comparators/test_image.py | 4 ++--
tests/comparators/test_ipk.py | 4 ++--
tests/comparators/test_iso9660.py | 4 ++--
tests/comparators/test_java.py | 4 ++--
tests/comparators/test_javascript.py | 4 ++--
tests/comparators/test_macho.py | 4 ++--
tests/comparators/test_mono.py | 4 ++--
tests/comparators/test_openssh_pub_key.py | 4 ++--
tests/comparators/test_tar.py | 4 ++--
tests/comparators/utils.py | 4 ++--
25 files changed, 66 insertions(+), 66 deletions(-)
diff --git a/diffoscope/comparators/__init__.py b/diffoscope/comparators/__init__.py
index e9a6e3d..63f8680 100644
--- a/diffoscope/comparators/__init__.py
+++ b/diffoscope/comparators/__init__.py
@@ -30,12 +30,12 @@ from diffoscope.config import Config
from diffoscope.profiling import profile
from diffoscope.difference import Difference
-from .binary import NonExistingFile
+from .binary import MissingFile
COMPARATORS = (
('directory.Directory',),
- ('binary.NonExistingFile',),
+ ('binary.MissingFile',),
('symlink.Symlink',),
('device.Device',),
('debian.DotChangesFile', 'debian_fallback.DotChangesFile'),
diff --git a/diffoscope/comparators/binary.py b/diffoscope/comparators/binary.py
index 7211af9..6ba6c45 100644
--- a/diffoscope/comparators/binary.py
+++ b/diffoscope/comparators/binary.py
@@ -277,7 +277,7 @@ class FilesystemFile(File):
return stat.S_ISCHR(mode) or stat.S_ISBLK(mode)
-class NonExistingFile(File):
+class MissingFile(File):
"""Represents a missing file when comparing containers"""
@staticmethod
@@ -319,7 +319,7 @@ class NonExistingFile(File):
# So now that comparators are all object-oriented, we don't have any clue on how to
# perform a meaningful comparison right here. So we are good do the comparison backward
# (where knowledge of the file format lies) and and then reverse it.
- if isinstance(other, NonExistingFile):
+ if isinstance(other, MissingFile):
return Difference(None, self.name, other.name, comment='Trying to compare two non-existing files.')
logger.debug('Performing backward comparison')
backward_diff = other.compare(self, source)
diff --git a/diffoscope/comparators/utils/__init__.py b/diffoscope/comparators/utils/__init__.py
index a026889..40321db 100644
--- a/diffoscope/comparators/utils/__init__.py
+++ b/diffoscope/comparators/utils/__init__.py
@@ -35,7 +35,7 @@ from .fuzzy import perform_fuzzy_matching
from .compare import compare_commented_files
from .. import specialize
-from ..binary import File, NonExistingFile
+from ..binary import File, MissingFile
class Command(object, metaclass=abc.ABCMeta):
def __init__(self, path):
@@ -137,8 +137,8 @@ NO_COMMENT = None
class Container(object, metaclass=abc.ABCMeta):
def __new__(cls, source):
- if isinstance(source, NonExistingFile):
- new = super(Container, NonExistingContainer).__new__(NonExistingContainer)
+ if isinstance(source, MissingFile):
+ new = super(Container, MissingContainer).__new__(MissingContainer)
new.__init__(source)
return new
else:
@@ -206,22 +206,22 @@ class Container(object, metaclass=abc.ABCMeta):
p.step(2)
if Config().new_file:
for my_member in my_members.values():
- yield my_member, NonExistingFile('/dev/null', my_member), NO_COMMENT
+ yield my_member, MissingFile('/dev/null', my_member), NO_COMMENT
p.step()
for other_member in other_members.values():
- yield NonExistingFile('/dev/null', other_member), other_member, NO_COMMENT
+ yield MissingFile('/dev/null', other_member), other_member, NO_COMMENT
p.step()
def compare(self, other, source=None):
return itertools.starmap(compare_commented_files, self.comparisons(other))
-class NonExistingContainer(Container):
+class MissingContainer(Container):
def get_member_names(self):
return self.source.other_file.as_container.get_member_names()
def get_member(self, member_name):
- return NonExistingFile('/dev/null')
+ return MissingFile('/dev/null')
class ArchiveMember(File):
@@ -261,8 +261,8 @@ class ArchiveMember(File):
class Archive(Container, metaclass=abc.ABCMeta):
def __new__(cls, source, *args, **kwargs):
- if isinstance(source, NonExistingFile):
- return super(Container, NonExistingArchive).__new__(NonExistingArchive)
+ if isinstance(source, MissingFile):
+ return super(Container, MissingArchive).__new__(MissingArchive)
else:
return super(Container, cls).__new__(cls)
@@ -299,7 +299,7 @@ class Archive(Container, metaclass=abc.ABCMeta):
return ArchiveMember(self, member_name)
-class NonExistingArchiveLikeObject(object):
+class MissingArchiveLikeObject(object):
def getnames(self):
return []
@@ -310,13 +310,13 @@ class NonExistingArchiveLikeObject(object):
pass
-class NonExistingArchive(Archive):
+class MissingArchive(Archive):
@property
def source(self):
return None
def open_archive(self):
- return NonExistingArchiveLikeObject()
+ return MissingArchiveLikeObject()
def close_archive(self):
pass
@@ -329,7 +329,7 @@ class NonExistingArchive(Archive):
raise NotImplementedError()
def get_member(self, member_name):
- return NonExistingFile('/dev/null')
+ return MissingFile('/dev/null')
# Be nice to gzip and the likes
@property
diff --git a/diffoscope/comparators/utils/compare.py b/diffoscope/comparators/utils/compare.py
index e5e3e1d..faa6164 100644
--- a/diffoscope/comparators/utils/compare.py
+++ b/diffoscope/comparators/utils/compare.py
@@ -7,7 +7,7 @@ from diffoscope.profiling import profile
from diffoscope.difference import Difference
from .. import specialize
-from ..binary import NonExistingFile
+from ..binary import MissingFile
def compare_root_paths(path1, path2):
@@ -31,9 +31,9 @@ def compare_files(file1, file2, source=None):
return None
specialize(file1)
specialize(file2)
- if isinstance(file1, NonExistingFile):
+ if isinstance(file1, MissingFile):
file1.other_file = file2
- elif isinstance(file2, NonExistingFile):
+ elif isinstance(file2, MissingFile):
file2.other_file = file1
elif file1.__class__.__name__ != file2.__class__.__name__:
return file1.compare_bytes(file2, source)
diff --git a/tests/comparators/test_binary.py b/tests/comparators/test_binary.py
index 4567727..cc46396 100644
--- a/tests/comparators/test_binary.py
+++ b/tests/comparators/test_binary.py
@@ -25,7 +25,7 @@ import diffoscope.comparators.binary
from diffoscope import tool_required
from diffoscope.exc import RequiredToolNotFound
from diffoscope.difference import Difference
-from diffoscope.comparators.binary import File, FilesystemFile, NonExistingFile
+from diffoscope.comparators.binary import File, FilesystemFile, MissingFile
from utils import skip_unless_tools_exist, data, load_fixture
from os import mkdir, symlink
@@ -78,7 +78,7 @@ def test_compare_with_xxd(binary1, binary2):
assert normalize_zeros(difference.unified_diff) == expected_diff
def test_compare_non_existing_with_xxd(binary1):
- difference = binary1.compare_bytes(NonExistingFile('/nonexisting', binary1))
+ difference = binary1.compare_bytes(MissingFile('/nonexisting', binary1))
assert difference.source2 == '/nonexisting'
@pytest.fixture
@@ -148,8 +148,8 @@ def test_with_compare_details_and_tool_not_found(monkeypatch):
assert normalize_zeros(difference.unified_diff) == expected_diff
def test_compare_two_nonexisting_files():
- file1 = NonExistingFile('/nonexisting1')
- file2 = NonExistingFile('/nonexisting2')
+ file1 = MissingFile('/nonexisting1')
+ file2 = MissingFile('/nonexisting2')
difference = file1.compare(file2)
assert 'non-existing' in difference.comment
diff --git a/tests/comparators/test_deb.py b/tests/comparators/test_deb.py
index 0fa5c31..fd68c92 100644
--- a/tests/comparators/test_deb.py
+++ b/tests/comparators/test_deb.py
@@ -24,7 +24,7 @@ import diffoscope.comparators
from diffoscope.config import Config
from diffoscope.comparators import specialize
from diffoscope.comparators.deb import DebFile, Md5sumsFile, DebDataTarFile
-from diffoscope.comparators.binary import FilesystemFile, NonExistingFile
+from diffoscope.comparators.binary import FilesystemFile, MissingFile
from utils import data, load_fixture
@@ -102,6 +102,6 @@ def test_skip_comparison_of_known_identical_files(deb1, deb2, monkeypatch):
def test_compare_non_existing(monkeypatch, deb1):
monkeypatch.setattr(Config(), 'new_file', True)
- difference = deb1.compare(NonExistingFile('/nonexisting', deb1))
+ difference = deb1.compare(MissingFile('/nonexisting', deb1))
assert difference.source2 == '/nonexisting'
assert difference.details[-1].source2 == '/dev/null'
diff --git a/tests/comparators/test_debian.py b/tests/comparators/test_debian.py
index 45b6142..82122c9 100644
--- a/tests/comparators/test_debian.py
+++ b/tests/comparators/test_debian.py
@@ -23,7 +23,7 @@ import pytest
from diffoscope.config import Config
from diffoscope.comparators import specialize
from diffoscope.presenters.text import output_text
-from diffoscope.comparators.binary import FilesystemFile, NonExistingFile
+from diffoscope.comparators.binary import FilesystemFile, MissingFile
from utils import data, assert_non_existing
@@ -116,7 +116,7 @@ def test_dot_changes_internal_diff(dot_changes_differences):
@pytest.mark.skipif(miss_debian_module, reason='debian module is not installed')
def test_dot_changes_compare_non_existing(monkeypatch, dot_changes1):
monkeypatch.setattr(Config(), 'new_file', True)
- difference = dot_changes1.compare(NonExistingFile('/nonexisting', dot_changes1))
+ difference = dot_changes1.compare(MissingFile('/nonexisting', dot_changes1))
output_text(difference, print_func=print)
assert difference.source2 == '/nonexisting'
assert difference.details[-1].source2 == '/dev/null'
@@ -210,7 +210,7 @@ def test_dot_dsc_internal_diff(dot_dsc_differences):
@pytest.mark.skipif(miss_debian_module, reason='debian module is not installed')
def test_dot_dsc_compare_non_existing(monkeypatch, dot_dsc1):
monkeypatch.setattr(Config(), 'new_file', True)
- difference = dot_dsc1.compare(NonExistingFile('/nonexisting', dot_dsc1))
+ difference = dot_dsc1.compare(MissingFile('/nonexisting', dot_dsc1))
output_text(difference, print_func=print)
assert difference.source2 == '/nonexisting'
assert difference.details[-1].source2 == '/dev/null'
diff --git a/tests/comparators/test_dex.py b/tests/comparators/test_dex.py
index 23c044d..9867a93 100644
--- a/tests/comparators/test_dex.py
+++ b/tests/comparators/test_dex.py
@@ -22,7 +22,7 @@ import subprocess
from diffoscope.config import Config
from diffoscope.comparators.dex import DexFile
-from diffoscope.comparators.binary import NonExistingFile
+from diffoscope.comparators.binary import MissingFile
from utils import skip_unless_tools_exist, data, load_fixture, skip_unless_tool_is_at_least
from test_java import javap_version
@@ -72,6 +72,6 @@ def test_differences(differences):
@skip_unless_tools_exist('enjarify', 'zipinfo', 'javap')
def test_compare_non_existing(monkeypatch, dex1):
monkeypatch.setattr(Config(), 'new_file', True)
- difference = dex1.compare(NonExistingFile('/nonexisting', dex1))
+ difference = dex1.compare(MissingFile('/nonexisting', dex1))
assert difference.source2 == '/nonexisting'
assert difference.details[-1].source2 == '/dev/null'
diff --git a/tests/comparators/test_elf.py b/tests/comparators/test_elf.py
index 83d5a63..e7bf1e7 100644
--- a/tests/comparators/test_elf.py
+++ b/tests/comparators/test_elf.py
@@ -24,7 +24,7 @@ from diffoscope.config import Config
from diffoscope.comparators import specialize
from diffoscope.presenters.text import output_text
from diffoscope.comparators.elf import ElfFile, StaticLibFile
-from diffoscope.comparators.binary import FilesystemFile, NonExistingFile
+from diffoscope.comparators.binary import FilesystemFile, MissingFile
from diffoscope.comparators.directory import FilesystemDirectory
from utils import skip_unless_tools_exist, data, load_fixture
@@ -52,7 +52,7 @@ def obj_differences(obj1, obj2):
@skip_unless_tools_exist('readelf')
def test_obj_compare_non_existing(monkeypatch, obj1):
monkeypatch.setattr(Config(), 'new_file', True)
- difference = obj1.compare(NonExistingFile('/nonexisting', obj1))
+ difference = obj1.compare(MissingFile('/nonexisting', obj1))
assert difference.source2 == '/nonexisting'
assert len(difference.details) > 0
@@ -97,7 +97,7 @@ def test_lib_differences(lib_differences):
@skip_unless_tools_exist('readelf', 'objdump')
def test_lib_compare_non_existing(monkeypatch, lib1):
monkeypatch.setattr(Config(), 'new_file', True)
- difference = lib1.compare(NonExistingFile('/nonexisting', lib1))
+ difference = lib1.compare(MissingFile('/nonexisting', lib1))
assert difference.source2 == '/nonexisting'
assert len(difference.details) > 0
diff --git a/tests/comparators/test_epub.py b/tests/comparators/test_epub.py
index 31db0cd..8b55086 100644
--- a/tests/comparators/test_epub.py
+++ b/tests/comparators/test_epub.py
@@ -21,7 +21,7 @@ import pytest
from diffoscope.config import Config
from diffoscope.comparators.zip import ZipFile
-from diffoscope.comparators.binary import NonExistingFile
+from diffoscope.comparators.binary import MissingFile
from utils import skip_unless_tools_exist, data, load_fixture
@@ -55,6 +55,6 @@ def test_differences(differences):
@skip_unless_tools_exist('zipinfo')
def test_compare_non_existing(monkeypatch, epub1):
monkeypatch.setattr(Config(), 'new_file', True)
- difference = epub1.compare(NonExistingFile('/nonexisting', epub1))
+ difference = epub1.compare(MissingFile('/nonexisting', epub1))
assert difference.source2 == '/nonexisting'
assert difference.details[-1].source2 == '/dev/null'
diff --git a/tests/comparators/test_fonts.py b/tests/comparators/test_fonts.py
index 8c67568..266541f 100644
--- a/tests/comparators/test_fonts.py
+++ b/tests/comparators/test_fonts.py
@@ -21,7 +21,7 @@ import pytest
from diffoscope.config import Config
from diffoscope.comparators.fonts import TtfFile
-from diffoscope.comparators.binary import NonExistingFile
+from diffoscope.comparators.binary import MissingFile
from utils import skip_unless_tools_exist, data, load_fixture
@@ -48,6 +48,6 @@ def test_diff(differences):
@skip_unless_tools_exist('showttf')
def test_compare_non_existing(monkeypatch, ttf1):
monkeypatch.setattr(Config(), 'new_file', True)
- difference = ttf1.compare(NonExistingFile('/nonexisting', ttf1))
+ difference = ttf1.compare(MissingFile('/nonexisting', ttf1))
assert difference.source2 == '/nonexisting'
assert len(difference.details) > 0
diff --git a/tests/comparators/test_fsimage.py b/tests/comparators/test_fsimage.py
index 9847b5d..7942442 100644
--- a/tests/comparators/test_fsimage.py
+++ b/tests/comparators/test_fsimage.py
@@ -20,7 +20,7 @@
import pytest
from diffoscope.config import Config
-from diffoscope.comparators.binary import NonExistingFile
+from diffoscope.comparators.binary import MissingFile
from diffoscope.comparators.fsimage import FsImageFile
from utils import skip_unless_tools_exist, data, load_fixture
@@ -82,6 +82,6 @@ def test_differences(differences):
@pytest.mark.skipif(miss_guestfs, reason='guestfs is missing')
def test_compare_non_existing(monkeypatch, img1):
monkeypatch.setattr(Config(), 'new_file', True)
- difference = img1.compare(NonExistingFile('/nonexisting', img1))
+ difference = img1.compare(MissingFile('/nonexisting', img1))
assert difference.source2 == '/nonexisting'
assert difference.details[-1].source2 == '/dev/null'
diff --git a/tests/comparators/test_gettext.py b/tests/comparators/test_gettext.py
index 069c625..ea49362 100644
--- a/tests/comparators/test_gettext.py
+++ b/tests/comparators/test_gettext.py
@@ -21,7 +21,7 @@ import codecs
import pytest
from diffoscope.config import Config
-from diffoscope.comparators.binary import NonExistingFile
+from diffoscope.comparators.binary import MissingFile
from diffoscope.comparators.gettext import MoFile
from utils import skip_unless_tools_exist, data, load_fixture
@@ -57,6 +57,6 @@ def test_charsets(mo_no_charset, mo_iso8859_1):
@skip_unless_tools_exist('msgunfmt')
def test_compare_non_existing(monkeypatch, mo1):
monkeypatch.setattr(Config(), 'new_file', True)
- difference = mo1.compare(NonExistingFile('/nonexisting', mo1))
+ difference = mo1.compare(MissingFile('/nonexisting', mo1))
assert difference.source2 == '/nonexisting'
assert len(difference.details) > 0
diff --git a/tests/comparators/test_gzip.py b/tests/comparators/test_gzip.py
index 9a0f786..6418db4 100644
--- a/tests/comparators/test_gzip.py
+++ b/tests/comparators/test_gzip.py
@@ -23,7 +23,7 @@ import pytest
from diffoscope.config import Config
from diffoscope.comparators import specialize
from diffoscope.comparators.gzip import GzipFile
-from diffoscope.comparators.binary import FilesystemFile, NonExistingFile
+from diffoscope.comparators.binary import FilesystemFile, MissingFile
from utils import data, load_fixture
@@ -72,6 +72,6 @@ def test_content_diff(differences):
def test_compare_non_existing(monkeypatch, gzip1):
monkeypatch.setattr(Config(), 'new_file', True)
- difference = gzip1.compare(NonExistingFile('/nonexisting', gzip1))
+ difference = gzip1.compare(MissingFile('/nonexisting', gzip1))
assert difference.source2 == '/nonexisting'
assert difference.details[-1].source2 == '/dev/null'
diff --git a/tests/comparators/test_icc.py b/tests/comparators/test_icc.py
index 9c59433..1cb1748 100644
--- a/tests/comparators/test_icc.py
+++ b/tests/comparators/test_icc.py
@@ -21,7 +21,7 @@ import pytest
from diffoscope.config import Config
from diffoscope.comparators.icc import IccFile
-from diffoscope.comparators.binary import NonExistingFile
+from diffoscope.comparators.binary import MissingFile
from utils import skip_unless_tools_exist, data, load_fixture
@@ -47,7 +47,7 @@ def test_diff(differences):
@skip_unless_tools_exist('cd-iccdump')
def test_compare_non_existing(monkeypatch, icc1):
monkeypatch.setattr(Config(), 'new_file', True)
- difference = icc1.compare(NonExistingFile('/nonexisting', icc1))
+ difference = icc1.compare(MissingFile('/nonexisting', icc1))
assert difference.source2 == '/nonexisting'
assert len(difference.details) > 0
diff --git a/tests/comparators/test_image.py b/tests/comparators/test_image.py
index 640b88c..09f0632 100644
--- a/tests/comparators/test_image.py
+++ b/tests/comparators/test_image.py
@@ -21,7 +21,7 @@ import pytest
from diffoscope.config import Config
from diffoscope.comparators.image import ImageFile
-from diffoscope.comparators.binary import NonExistingFile
+from diffoscope.comparators.binary import MissingFile
from utils import skip_unless_tools_exist, data, load_fixture
@@ -47,6 +47,6 @@ def test_diff(differences):
@skip_unless_tools_exist('img2txt')
def test_compare_non_existing(monkeypatch, image1):
monkeypatch.setattr(Config(), 'new_file', True)
- difference = image1.compare(NonExistingFile('/nonexisting', image1))
+ difference = image1.compare(MissingFile('/nonexisting', image1))
assert difference.source2 == '/nonexisting'
assert len(difference.details) > 0
diff --git a/tests/comparators/test_ipk.py b/tests/comparators/test_ipk.py
index ea01b9f..95fc24e 100644
--- a/tests/comparators/test_ipk.py
+++ b/tests/comparators/test_ipk.py
@@ -21,7 +21,7 @@ import pytest
from diffoscope.config import Config
from diffoscope.comparators.ipk import IpkFile
-from diffoscope.comparators.binary import NonExistingFile
+from diffoscope.comparators.binary import MissingFile
from utils import data, load_fixture
@@ -50,6 +50,6 @@ def test_compressed_files(differences):
def test_compare_non_existing(monkeypatch, ipk1):
monkeypatch.setattr(Config(), 'new_file', True)
- difference = ipk1.compare(NonExistingFile('/nonexisting', ipk1))
+ difference = ipk1.compare(MissingFile('/nonexisting', ipk1))
assert difference.source2 == '/nonexisting'
assert difference.details[-1].source2 == '/dev/null'
diff --git a/tests/comparators/test_iso9660.py b/tests/comparators/test_iso9660.py
index b09ac53..0d0f35a 100644
--- a/tests/comparators/test_iso9660.py
+++ b/tests/comparators/test_iso9660.py
@@ -20,7 +20,7 @@
import pytest
from diffoscope.config import Config
-from diffoscope.comparators.binary import NonExistingFile
+from diffoscope.comparators.binary import MissingFile
from diffoscope.comparators.iso9660 import Iso9660File
from utils import skip_unless_tools_exist, data, load_fixture
@@ -65,6 +65,6 @@ def test_compressed_files(differences):
@skip_unless_tools_exist('isoinfo')
def test_compare_non_existing(monkeypatch, iso1):
monkeypatch.setattr(Config(), 'new_file', True)
- difference = iso1.compare(NonExistingFile('/nonexisting', iso1))
+ difference = iso1.compare(MissingFile('/nonexisting', iso1))
assert difference.source2 == '/nonexisting'
assert difference.details[-1].source2 == '/dev/null'
diff --git a/tests/comparators/test_java.py b/tests/comparators/test_java.py
index 586233d..83c77ed 100644
--- a/tests/comparators/test_java.py
+++ b/tests/comparators/test_java.py
@@ -22,7 +22,7 @@ import subprocess
from diffoscope.config import Config
from diffoscope.comparators.java import ClassFile
-from diffoscope.comparators.binary import NonExistingFile
+from diffoscope.comparators.binary import MissingFile
from utils import skip_unless_tools_exist, data, load_fixture, skip_unless_tool_is_at_least
@@ -55,6 +55,6 @@ def test_diff(differences):
@skip_unless_tools_exist('javap')
def test_compare_non_existing(monkeypatch, class1):
monkeypatch.setattr(Config(), 'new_file', True)
- difference = class1.compare(NonExistingFile('/nonexisting', class1))
+ difference = class1.compare(MissingFile('/nonexisting', class1))
assert difference.source2 == '/nonexisting'
assert len(difference.details) > 0
diff --git a/tests/comparators/test_javascript.py b/tests/comparators/test_javascript.py
index 4fb3a31..c26f7c9 100644
--- a/tests/comparators/test_javascript.py
+++ b/tests/comparators/test_javascript.py
@@ -21,7 +21,7 @@ import pytest
from diffoscope.config import Config
from diffoscope.comparators.javascript import JavaScriptFile
-from diffoscope.comparators.binary import NonExistingFile
+from diffoscope.comparators.binary import MissingFile
from utils import skip_unless_tools_exist, data, load_fixture
@@ -47,6 +47,6 @@ def test_diff(differences):
@skip_unless_tools_exist('js-beautify')
def test_compare_non_existing(monkeypatch, javascript1):
monkeypatch.setattr(Config(), 'new_file', True)
- difference = javascript1.compare(NonExistingFile('/nonexisting', javascript1))
+ difference = javascript1.compare(MissingFile('/nonexisting', javascript1))
assert difference.source2 == '/nonexisting'
assert len(difference.details) > 0
diff --git a/tests/comparators/test_macho.py b/tests/comparators/test_macho.py
index 176747b..bb880f8 100644
--- a/tests/comparators/test_macho.py
+++ b/tests/comparators/test_macho.py
@@ -23,7 +23,7 @@ import os.path
from diffoscope.config import Config
from diffoscope.comparators.macho import MachoFile
-from diffoscope.comparators.binary import NonExistingFile
+from diffoscope.comparators.binary import MissingFile
from utils import skip_unless_tools_exist, data, load_fixture
@@ -44,7 +44,7 @@ def obj_differences(obj1, obj2):
@skip_unless_tools_exist('otool', 'lipo')
def test_obj_compare_non_existing(monkeypatch, obj1):
monkeypatch.setattr(Config(), 'new_file', True)
- difference = obj1.compare(NonExistingFile('/nonexisting', obj1))
+ difference = obj1.compare(MissingFile('/nonexisting', obj1))
assert difference.source2 == '/nonexisting'
assert len(difference.details) > 0
diff --git a/tests/comparators/test_mono.py b/tests/comparators/test_mono.py
index f265fdb..a848386 100644
--- a/tests/comparators/test_mono.py
+++ b/tests/comparators/test_mono.py
@@ -21,7 +21,7 @@ import pytest
from diffoscope.config import Config
from diffoscope.comparators.mono import MonoExeFile
-from diffoscope.comparators.binary import NonExistingFile
+from diffoscope.comparators.binary import MissingFile
from utils import skip_unless_tools_exist, data, load_fixture
@@ -52,6 +52,6 @@ def test_diff(differences):
@skip_unless_tools_exist('pedump')
def test_compare_non_existing(monkeypatch, exe1):
monkeypatch.setattr(Config(), 'new_file', True)
- difference = exe1.compare(NonExistingFile('/nonexisting', exe1))
+ difference = exe1.compare(MissingFile('/nonexisting', exe1))
assert difference.source2 == '/nonexisting'
assert len(difference.details) > 0
diff --git a/tests/comparators/test_openssh_pub_key.py b/tests/comparators/test_openssh_pub_key.py
index ac42f48..d99d0b9 100644
--- a/tests/comparators/test_openssh_pub_key.py
+++ b/tests/comparators/test_openssh_pub_key.py
@@ -21,7 +21,7 @@ import pytest
from diffoscope.config import Config
from diffoscope.comparators.openssh import PublicKeyFile
-from diffoscope.comparators.binary import NonExistingFile
+from diffoscope.comparators.binary import MissingFile
from utils import skip_unless_tools_exist, data, load_fixture
@@ -49,6 +49,6 @@ def test_diff(differences):
@skip_unless_tools_exist('ssh-keygen')
def test_compare_non_existing(monkeypatch, opensshpubkey1):
monkeypatch.setattr(Config(), 'new_file', True)
- difference = opensshpubkey1.compare(NonExistingFile('/nonexisting', opensshpubkey1))
+ difference = opensshpubkey1.compare(MissingFile('/nonexisting', opensshpubkey1))
assert difference.source2 == '/nonexisting'
assert len(difference.details) > 0
diff --git a/tests/comparators/test_tar.py b/tests/comparators/test_tar.py
index 858ddbe..6415850 100644
--- a/tests/comparators/test_tar.py
+++ b/tests/comparators/test_tar.py
@@ -21,7 +21,7 @@ import pytest
from diffoscope.config import Config
from diffoscope.comparators.tar import TarFile
-from diffoscope.comparators.binary import NonExistingFile
+from diffoscope.comparators.binary import MissingFile
from utils import data, load_fixture, assert_non_existing
@@ -67,4 +67,4 @@ def test_no_permissions_dir_in_tarball(monkeypatch, no_permissions_tar):
# We want to make sure OSError is not raised.
# Comparing with non-existing file makes it easy to make sure all files are unpacked
monkeypatch.setattr(Config(), 'new_file', True)
- no_permissions_tar.compare(NonExistingFile('/nonexistent', no_permissions_tar))
+ no_permissions_tar.compare(MissingFile('/nonexistent', no_permissions_tar))
diff --git a/tests/comparators/utils.py b/tests/comparators/utils.py
index 81cc6bd..90fee76 100644
--- a/tests/comparators/utils.py
+++ b/tests/comparators/utils.py
@@ -29,7 +29,7 @@ from diffoscope.config import Config
from diffoscope.comparators import specialize
from diffoscope.presenters.html import output_html
from diffoscope.presenters.text import output_text
-from diffoscope.comparators.binary import FilesystemFile, NonExistingFile
+from diffoscope.comparators.binary import FilesystemFile, MissingFile
re_diff_line_numbers = re.compile(r"(^|\n)@@ -(\d+),(\d+) \+(\d+),(\d+) @@(?=\n|$)")
@@ -69,7 +69,7 @@ def assert_non_existing(monkeypatch, fixture, has_null_source=True, has_details=
monkeypatch.setattr(Config(), 'new_file', True)
assert Config().new_file, "didnt get patched"
- difference = fixture.compare(NonExistingFile('/nonexisting', fixture))
+ difference = fixture.compare(MissingFile('/nonexisting', fixture))
output_html(difference, print_func=print)
output_text(difference, print_func=print)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the diffoscope
mailing list