[Git][reproducible-builds/diffoscope][master] Use a simpler, previous fix to support gnumeric 1.12.43.

Chris Lamb gitlab at salsa.debian.org
Sun Sep 30 14:02:47 CEST 2018


Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
47588095 by Chris Lamb at 2018-09-30T12:01:05Z
Use a simpler, previous fix to support gnumeric 1.12.43.

This reverts both 344ae4d61439eb148205fba7ede53dc7d6164a5b and
ef5ae4962d8f729b096341e21c78b10c91f2b451. The mess was caused by me not
actually pushing my change causing duplicated work by Mattia. Mea culpa...

- - - - -


4 changed files:

- diffoscope/comparators/gnumeric.py
- tests/comparators/test_gnumeric.py
- − tests/data/gnumeric_1.12.43_expected_diff
- tests/data/gnumeric_1.12.42_expected_diff → tests/data/gnumeric_expected_diff


Changes:

=====================================
diffoscope/comparators/gnumeric.py
=====================================
@@ -61,4 +61,4 @@ class GnumericFile(File):
         ))
 
         with open(t.name) as f:
-            return f.read()
+            return f.read().strip()


=====================================
tests/comparators/test_gnumeric.py
=====================================
@@ -18,27 +18,17 @@
 # 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)
 
@@ -53,15 +43,9 @@ def differences(gnumeric1, gnumeric2):
     return gnumeric1.compare(gnumeric2).details
 
 
- 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')
+ at skip_unless_tools_exist('ssconvert')
+def test_diff(differences):
+    expected_diff = get_data('gnumeric_expected_diff')
     assert differences[0].unified_diff == expected_diff
 
 


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


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



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

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/commit/47588095d15b4611f2ef1cfc063ce4f0d397d294
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/20180930/90887c3d/attachment.html>


More information about the rb-commits mailing list