[Git][reproducible-builds/diffoscope][master] 3 commits: Fix compataibility with file 5.45. (Closes: reproducible-builds/diffoscope#346)

Chris Lamb (@lamby) gitlab at salsa.debian.org
Tue Aug 1 10:15:29 UTC 2023



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
435a8fe9 by Chris Lamb at 2023-08-01T11:12:41+01:00
Fix compataibility with file 5.45. (Closes: reproducible-builds/diffoscope#346)

- - - - -
346f7ce3 by Chris Lamb at 2023-08-01T11:13:35+01:00
Use assert_diff in test_uimage.

- - - - -
d306e511 by Chris Lamb at 2023-08-01T11:14:57+01:00
Use assert_diff in test_cpio.

- - - - -


2 changed files:

- tests/comparators/test_cpio.py
- tests/comparators/test_uimage.py


Changes:

=====================================
tests/comparators/test_cpio.py
=====================================
@@ -21,8 +21,11 @@ import pytest
 
 from diffoscope.comparators.cpio import CpioFile
 
-from ..utils.data import load_fixture, get_data
-from ..utils.tools import skip_unless_tools_exist
+from ..utils.data import load_fixture, assert_diff
+from ..utils.tools import (
+    skip_unless_tools_exist,
+    skip_unless_file_version_is_at_least,
+)
 from ..utils.nonexisting import assert_non_existing
 
 cpio1 = load_fixture("test1.cpio")
@@ -46,24 +49,23 @@ def differences(cpio1, cpio2):
 
 @skip_unless_tools_exist("cpio")
 def test_listing(differences):
-    expected_diff = get_data("cpio_listing_expected_diff")
-    assert differences[0].unified_diff == expected_diff
+    assert_diff(differences[0], "cpio_listing_expected_diff")
 
 
 @skip_unless_tools_exist("cpio")
+ at skip_unless_file_version_is_at_least("5.45")
 def test_symlink(differences):
-    assert differences[1].source1 == "dir/link"
-    assert differences[1].comment == "symlink"
-    expected_diff = get_data("symlink_expected_diff")
-    assert differences[1].unified_diff == expected_diff
+    assert differences[2].source1 == "dir/link"
+    assert differences[2].comment == "symlink"
+    assert_diff(differences[2], "symlink_expected_diff")
 
 
 @skip_unless_tools_exist("cpio")
+ at skip_unless_file_version_is_at_least("5.45")
 def test_compressed_files(differences):
-    assert differences[2].source1 == "dir/text"
-    assert differences[2].source2 == "dir/text"
-    expected_diff = get_data("text_ascii_expected_diff")
-    assert differences[2].unified_diff == expected_diff
+    assert differences[3].source1 == "dir/text"
+    assert differences[3].source2 == "dir/text"
+    assert_diff(differences[3], "text_ascii_expected_diff")
 
 
 @skip_unless_tools_exist("cpio")


=====================================
tests/comparators/test_uimage.py
=====================================
@@ -23,8 +23,12 @@ from diffoscope.comparators.binary import FilesystemFile
 from diffoscope.comparators.uimage import UimageFile
 from diffoscope.comparators.utils.specialize import specialize
 
-from ..utils.data import load_fixture, get_data, assert_diff
-from ..utils.tools import skip_unless_tools_exist, file_version_is_lt
+from ..utils.data import load_fixture, assert_diff
+from ..utils.tools import (
+    skip_unless_tools_exist,
+    file_version_is_lt,
+    skip_unless_file_version_is_at_least,
+)
 from ..utils.nonexisting import assert_non_existing
 
 cpio1 = load_fixture("test1.cpio")
@@ -108,24 +112,23 @@ def test_file_differences(differences):
 
 @skip_unless_tools_exist("cpio")
 def test_nested_listing(nested_differences):
-    expected_diff = get_data("cpio_listing_expected_diff")
-    assert nested_differences[0].unified_diff == expected_diff
+    assert_diff(nested_differences[0], "cpio_listing_expected_diff")
 
 
 @skip_unless_tools_exist("cpio")
+ at skip_unless_file_version_is_at_least("5.45")
 def test_nested_symlink(nested_differences):
-    assert nested_differences[1].source1 == "dir/link"
-    assert nested_differences[1].comment == "symlink"
-    expected_diff = get_data("symlink_expected_diff")
-    assert nested_differences[1].unified_diff == expected_diff
+    assert nested_differences[2].source1 == "dir/link"
+    assert nested_differences[2].comment == "symlink"
+    assert_diff(nested_differences[2], "symlink_expected_diff")
 
 
 @skip_unless_tools_exist("cpio")
+ at skip_unless_file_version_is_at_least("5.45")
 def test_nested_compressed_files(nested_differences):
-    assert nested_differences[2].source1 == "dir/text"
-    assert nested_differences[2].source2 == "dir/text"
-    expected_diff = get_data("text_ascii_expected_diff")
-    assert nested_differences[2].unified_diff == expected_diff
+    assert nested_differences[3].source1 == "dir/text"
+    assert nested_differences[3].source2 == "dir/text"
+    assert_diff(nested_differences[3], "text_ascii_expected_diff")
 
 
 @skip_unless_tools_exist("cpio")



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/364bdb0d67667b6c26795d8725cdb1abe4f0c315...d306e5111e272c23985e02680fe0fbac8d2a9b7a

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/364bdb0d67667b6c26795d8725cdb1abe4f0c315...d306e5111e272c23985e02680fe0fbac8d2a9b7a
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/20230801/1d36a0b8/attachment.htm>


More information about the rb-commits mailing list