[diffoscope] 01/01: skip_unless_tool_is_older_than => skip_unless_tool_is_at_least

Ximin Luo infinity0 at debian.org
Wed Nov 30 17:14:30 CET 2016


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository diffoscope.

commit 4727cce3dd74a51b02c57b8583776844be68f7d7
Author: Ximin Luo <infinity0 at debian.org>
Date:   Wed Nov 30 17:14:16 2016 +0100

    skip_unless_tool_is_older_than => skip_unless_tool_is_at_least
---
 tests/comparators/test_dex.py      | 4 ++--
 tests/comparators/test_java.py     | 4 ++--
 tests/comparators/test_ppu.py      | 6 +++---
 tests/comparators/test_rlib.py     | 4 ++--
 tests/comparators/test_squashfs.py | 4 ++--
 tests/comparators/test_utils.py    | 6 +++---
 tests/comparators/utils.py         | 2 +-
 7 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/tests/comparators/test_dex.py b/tests/comparators/test_dex.py
index deac9e0..6d4e810 100644
--- a/tests/comparators/test_dex.py
+++ b/tests/comparators/test_dex.py
@@ -23,7 +23,7 @@ from diffoscope.config import Config
 from diffoscope.comparators.dex import DexFile
 from diffoscope.comparators.binary import NonExistingFile
 
-from utils import skip_unless_tools_exist, data, load_fixture, skip_unless_tool_is_older_than
+from utils import skip_unless_tools_exist, data, load_fixture, skip_unless_tool_is_at_least
 from test_java import javap_version
 
 
@@ -42,7 +42,7 @@ def differences(dex1, dex2):
     return dex1.compare(dex2).details
 
 @skip_unless_tools_exist('enjarify', 'zipinfo', 'javap')
- at skip_unless_tool_is_older_than('javap', javap_version, '1.8')
+ at skip_unless_tool_is_at_least('javap', javap_version, '1.8')
 def test_differences(differences):
     assert differences[0].source1 == 'test1.jar'
     assert differences[0].source2 == 'test2.jar'
diff --git a/tests/comparators/test_java.py b/tests/comparators/test_java.py
index db5abce..2bf647c 100644
--- a/tests/comparators/test_java.py
+++ b/tests/comparators/test_java.py
@@ -24,7 +24,7 @@ from diffoscope.config import Config
 from diffoscope.comparators.java import ClassFile
 from diffoscope.comparators.binary import  NonExistingFile
 
-from utils import skip_unless_tools_exist, data, load_fixture, skip_unless_tool_is_older_than
+from utils import skip_unless_tools_exist, data, load_fixture, skip_unless_tool_is_at_least
 
 class1 = load_fixture(data('Test1.class'))
 class2 = load_fixture(data('Test2.class'))
@@ -47,7 +47,7 @@ def test_no_differences(class1):
 def differences(class1, class2):
     return class1.compare(class2).details
 
- at skip_unless_tool_is_older_than('javap', javap_version, '1.8')
+ at skip_unless_tool_is_at_least('javap', javap_version, '1.8')
 def test_diff(differences):
     expected_diff = open(data('class_expected_diff')).read()
     assert differences[0].unified_diff == expected_diff
diff --git a/tests/comparators/test_ppu.py b/tests/comparators/test_ppu.py
index 769b03c..4081075 100644
--- a/tests/comparators/test_ppu.py
+++ b/tests/comparators/test_ppu.py
@@ -24,7 +24,7 @@ import subprocess
 from diffoscope.comparators.ppu import PpuFile
 
 from utils import skip_unless_tools_exist, data, load_fixture, \
-    assert_non_existing, skip_unless_tool_is_older_than
+    assert_non_existing, skip_unless_tool_is_at_least
 
 # These test files were taken from two different builds of the Debian package
 # fp-units-castle-game-engine (version 5.1.1-2 on amd64) on the Debian
@@ -53,12 +53,12 @@ def test_no_differences(file1):
 def differences(file1, file2):
     return file1.compare(file2).details
 
- at skip_unless_tool_is_older_than('ppudump', ppudump_version, '3.0.0')
+ at skip_unless_tool_is_at_least('ppudump', ppudump_version, '3.0.0')
 def test_diff(differences):
     print(differences[0].unified_diff)
     expected_diff = open(data('ppu_expected_diff')).read()
     assert differences[0].unified_diff == expected_diff
 
- at skip_unless_tool_is_older_than('ppudump', ppudump_version, '3.0.0')
+ at skip_unless_tool_is_at_least('ppudump', ppudump_version, '3.0.0')
 def test_compare_non_existing(monkeypatch, file1):
     assert_non_existing(monkeypatch, file1, has_null_source=False)
diff --git a/tests/comparators/test_rlib.py b/tests/comparators/test_rlib.py
index f132bef..3ea809f 100644
--- a/tests/comparators/test_rlib.py
+++ b/tests/comparators/test_rlib.py
@@ -24,7 +24,7 @@ import subprocess
 from diffoscope.comparators.ar import ArFile
 from diffoscope.comparators.utils import diff_ignore_line_numbers
 
-from utils import skip_unless_tools_exist, skip_unless_tool_is_older_than, \
+from utils import skip_unless_tools_exist, skip_unless_tool_is_at_least, \
     skip_unless_tools_exist, data, load_fixture, assert_non_existing
 
 rlib1 = load_fixture(data('test1.rlib'))
@@ -68,7 +68,7 @@ def test_item2_rust_metadata_bin(differences):
     assert differences[2].source2 == 'rust.metadata.bin'
 
 @skip_unless_tools_exist('llvm-dis')
- at skip_unless_tool_is_older_than('llvm-config', llvm_version, '3.8')
+ at skip_unless_tool_is_at_least('llvm-config', llvm_version, '3.8')
 def test_item3_deflate_llvm_bitcode(differences):
     assert differences[3].source1 == 'alloc_system-d16b8f0e.0.bytecode.deflate'
     assert differences[3].source2 == 'alloc_system-d16b8f0e.0.bytecode.deflate'
diff --git a/tests/comparators/test_squashfs.py b/tests/comparators/test_squashfs.py
index a6d877e..82837d0 100644
--- a/tests/comparators/test_squashfs.py
+++ b/tests/comparators/test_squashfs.py
@@ -23,7 +23,7 @@ import subprocess
 from diffoscope.comparators.squashfs import SquashfsFile
 
 from utils import skip_unless_tools_exist, data, load_fixture, \
-    assert_non_existing, skip_unless_tool_is_older_than
+    assert_non_existing, skip_unless_tool_is_at_least
 
 def unsquashfs_version():
     # first line of 'unsquashfs -version' looks like:
@@ -53,7 +53,7 @@ def test_no_warnings(capfd, squashfs1, squashfs2):
 def differences(squashfs1, squashfs2):
     return squashfs1.compare(squashfs2).details
 
- at skip_unless_tool_is_older_than('unsquashfs', unsquashfs_version, '4.3')
+ at skip_unless_tool_is_at_least('unsquashfs', unsquashfs_version, '4.3')
 def test_superblock(differences):
     expected_diff = open(data('squashfs_superblock_expected_diff')).read()
     assert differences[0].unified_diff == expected_diff
diff --git a/tests/comparators/test_utils.py b/tests/comparators/test_utils.py
index 64e1dbb..2be6aba 100644
--- a/tests/comparators/test_utils.py
+++ b/tests/comparators/test_utils.py
@@ -25,7 +25,7 @@ from diffoscope.difference import Difference
 from diffoscope.comparators.utils import Command
 
 from utils import tools_missing, skip_unless_tools_exist, data, load_fixture, \
-    skip_unless_tool_is_older_than
+    skip_unless_tool_is_at_least
 
 try:
     import tlsh # noqa
@@ -51,8 +51,8 @@ def test_skip_unless_tools_exist_empty():
 def test_skip_unless_tools_exist_missing():
     pytest.xfail("Test should always be skipped")
 
-def skip_unless_tool_is_older_than():
-    func = skip_unless_tool_is_older_than
+def skip_unless_tool_is_at_least():
+    func = skip_unless_tool_is_at_least
     assert func('/missing', 1, 1).name is 'skip'
     # pytest.skipif().args[0] contains the evaluated statement
     assert func('cat', 1, 1).args[0] is False
diff --git a/tests/comparators/utils.py b/tests/comparators/utils.py
index 95e372e..f796378 100644
--- a/tests/comparators/utils.py
+++ b/tests/comparators/utils.py
@@ -44,7 +44,7 @@ def skip_unless_tools_exist(*required):
         reason="requires {}".format(" and ".join(required)),
     )
 
-def skip_unless_tool_is_older_than(tool, actual_ver, min_ver, vcls=LooseVersion):
+def skip_unless_tool_is_at_least(tool, actual_ver, min_ver, vcls=LooseVersion):
     if tools_missing(tool):
         return pytest.mark.skipif(True, reason="requires {}".format(tool))
     if callable(actual_ver):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list