diff --git a/flatpak-module-tools.spec b/flatpak-module-tools.spec index eaa3039..97499c6 100644 --- a/flatpak-module-tools.spec +++ b/flatpak-module-tools.spec @@ -11,6 +11,8 @@ Source0: https://releases.pagure.org/flatpak-module-tools/flatpak-module-tools-% # Avoid importing stray modules during FlatpakBuilder tests Patch0: test_flatpak_builder-reduce-test-dependencies.patch +# Test fix needed for latest appstream-compose +Patch1: test_tree_processor.py-update-appdata-contents-furth.patch BuildArch: noarch diff --git a/test_tree_processor.py-update-appdata-contents-furth.patch b/test_tree_processor.py-update-appdata-contents-furth.patch new file mode 100644 index 0000000..122696b --- /dev/null +++ b/test_tree_processor.py-update-appdata-contents-furth.patch @@ -0,0 +1,84 @@ +From 4bd0e74d58ebd6a12b30b0f3f34b1247a0f7e2a9 Mon Sep 17 00:00:00 2001 +From: "Owen W. Taylor" +Date: Fri, 18 Dec 2020 14:51:11 -0500 +Subject: [PATCH] test_tree_processor.py: update appdata contents further + +With latest appstream-compose without a type is an error; +add some asserts to make sure that the renamed test content we expect +is actually set up properly. +--- + tests/test_tree_processor.py | 31 ++++++++++++++++++------------- + 1 file changed, 18 insertions(+), 13 deletions(-) + +diff --git a/tests/test_tree_processor.py b/tests/test_tree_processor.py +index 47dcbca..79872ef 100644 +--- a/tests/test_tree_processor.py ++++ b/tests/test_tree_processor.py +@@ -15,10 +15,11 @@ APPDATA_CONTENTS = """\ + + + org.gnome.eog +- org.gnome.eog.desktop ++ org.gnome.eog.desktop + CC0-1.0 + GPL-2.0+ and GFDL-1.3 + Eye of GNOME ++ Browse and rotate images + +

+ The Eye of GNOME is the official image viewer for the GNOME desktop. +@@ -26,7 +27,6 @@ APPDATA_CONTENTS = """\ + formats for viewing single images or images in a collection. +

+
+- Browse and rotate images +
+ """ + +@@ -81,17 +81,23 @@ class AppTree(object): + appdata_contents = APPDATA_CONTENTS + desktop_contents = DESKTOP_CONTENTS + ++ def assert_sub(pattern, replacement, string): ++ new = re.sub(pattern, replacement, string) ++ assert new != string ++ ++ return new ++ + if rename_desktop_file: +- appdata_contents = re.sub(r'org\.gnome\.eog', +- r'' + rename_desktop_file + r'', +- appdata_contents) +- appdata_contents = re.sub(r'org\.gnome\.eog\.desktop', +- r'' + rename_desktop_file + r'', +- appdata_contents) ++ appdata_contents = assert_sub(r'org\.gnome\.eog', ++ r'' + rename_desktop_file + r'', ++ appdata_contents) ++ appdata_contents = assert_sub(r'org\.gnome\.eog\.desktop', ++ r'' + rename_desktop_file + r'', ++ appdata_contents) + if rename_icon: +- desktop_contents = re.sub(r'Icon(\[de\])?=org.gnome.eog.png', +- r'Icon\1=' + rename_icon, +- desktop_contents) ++ desktop_contents = assert_sub(r'Icon(\[de\])?=org.gnome.eog', ++ r'Icon\1=' + rename_icon, ++ desktop_contents) + + if rename_appdata_file: + if rename_appdata_file.endswith('metainfo.xml'): +@@ -155,9 +161,8 @@ def test_renames(app_tree, + + contents = app_tree.contents('files/share/app-info/xmls/org.gnome.eog.xml.gz', + decompress=True) +- print(contents) + assert 'org.gnome.eog' in contents +- assert 'org.gnome.eog.desktop' in contents ++ assert 'org.gnome.eog.desktop' in contents + + + def test_copy_icon(app_tree): +-- +2.29.2 +