[Git][reproducible-builds/diffoscope][master] Adapt tests to the output of gnumeric 1.12.43

Mattia Rizzolo gitlab at salsa.debian.org
Fri Sep 28 17:17:22 CEST 2018


Mattia Rizzolo pushed to branch master at Reproducible Builds / diffoscope


Commits:
ef5ae496 by Mattia Rizzolo at 2018-09-28T15:15:26Z
Adapt tests to the output of gnumeric 1.12.43

Signed-off-by: Mattia Rizzolo <mattia at debian.org>

- - - - -


3 changed files:

- tests/comparators/test_gnumeric.py
- tests/data/gnumeric_expected_diff → tests/data/gnumeric_1.12.42_expected_diff
- + tests/data/gnumeric_1.12.43_expected_diff


Changes:

=====================================
tests/comparators/test_gnumeric.py
=====================================
@@ -18,17 +18,27 @@
 # along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.
 
 import pytest
+import subprocess
 
 from diffoscope.comparators.gnumeric import GnumericFile
 
 from ..utils.data import load_fixture, get_data
-from ..utils.tools import skip_unless_tools_exist
 from ..utils.nonexisting import assert_non_existing
+from ..utils.tools import (
+    skip_unless_tools_exist,
+    skip_unless_tool_is_at_least,
+    skip_unless_tool_is_at_most,
+)
 
 gnumeric1 = load_fixture('test1.gnumeric')
 gnumeric2 = load_fixture('test2.gnumeric')
 
 
+def ssconvert_version():
+    out = subprocess.check_output(('ssconvert', '--version'))
+    return out.decode('utf-8').split()[2].replace("'", '')
+
+
 def test_identification(gnumeric1):
     assert isinstance(gnumeric1, GnumericFile)
 
@@ -43,12 +53,19 @@ def differences(gnumeric1, gnumeric2):
     return gnumeric1.compare(gnumeric2).details
 
 
- at skip_unless_tools_exist('ssconvert')
-def test_diff(differences):
-    expected_diff = get_data('gnumeric_expected_diff')
+ at skip_unless_tool_is_at_most('ssconvert', ssconvert_version, '1.12.42')
+def test_diff_old(differences):
+    expected_diff = get_data('gnumeric_1.12.42_expected_diff')
     assert differences[0].unified_diff == expected_diff
 
 
+ at skip_unless_tool_is_at_least('ssconvert', ssconvert_version, '1.12.43')
+def test_diff_new(differences):
+    expected_diff = get_data('gnumeric_1.12.43_expected_diff')
+    assert differences[0].unified_diff == expected_diff
+
+
+
 @skip_unless_tools_exist('ssconvert')
 def test_compare_non_existing(monkeypatch, gnumeric1):
     assert_non_existing(monkeypatch, gnumeric1, has_null_source=False)


=====================================
tests/data/gnumeric_expected_diff → tests/data/gnumeric_1.12.42_expected_diff
=====================================


=====================================
tests/data/gnumeric_1.12.43_expected_diff
=====================================
@@ -0,0 +1,5 @@
+@@ -1,3 +1,3 @@
+-foo
++bar
+ 
+ 



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/commit/ef5ae4962d8f729b096341e21c78b10c91f2b451

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/commit/ef5ae4962d8f729b096341e21c78b10c91f2b451
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20180928/dbb8700e/attachment.html>


More information about the rb-commits mailing list