[gnome-software/wip/async-plugin-repo-funcs: 44/60] flatpak: Replace GS_PLUGIN_ACTION_REMOVE_REPO job with manage repository job in tests




commit e4cfa2f915598ea76e811cc40dff24459a0612c0
Author: Milan Crha <mcrha redhat com>
Date:   Tue Jun 14 15:31:43 2022 +0200

    flatpak: Replace GS_PLUGIN_ACTION_REMOVE_REPO job with manage repository job in tests

 plugins/flatpak/gs-self-test.c | 44 +++++++++++-------------------------------
 1 file changed, 11 insertions(+), 33 deletions(-)
---
diff --git a/plugins/flatpak/gs-self-test.c b/plugins/flatpak/gs-self-test.c
index 621806d96..9bcc55a17 100644
--- a/plugins/flatpak/gs-self-test.c
+++ b/plugins/flatpak/gs-self-test.c
@@ -227,9 +227,7 @@ gs_plugins_flatpak_repo_func (GsPluginLoader *plugin_loader)
 
        /* remove it */
        g_object_unref (plugin_job);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REMOVE_REPO,
-                                        "app", app,
-                                        NULL);
+       plugin_job = gs_plugin_job_manage_repository_new (app, GS_PLUGIN_MANAGE_REPOSITORY_FLAGS_REMOVE);
        ret = gs_plugin_loader_job_action (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
@@ -508,9 +506,7 @@ gs_plugins_flatpak_app_with_runtime_func (GsPluginLoader *plugin_loader)
 
        /* remove the remote (fail, as the runtime is still installed) */
        g_object_unref (plugin_job);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REMOVE_REPO,
-                                        "app", app_source,
-                                        NULL);
+       plugin_job = gs_plugin_job_manage_repository_new (app_source, 
GS_PLUGIN_MANAGE_REPOSITORY_FLAGS_REMOVE);
        ret = gs_plugin_loader_job_action (plugin_loader, plugin_job, NULL, &error);
        g_assert_error (error, GS_PLUGIN_ERROR, GS_PLUGIN_ERROR_FAILED);
        g_assert_true (!ret);
@@ -530,9 +526,7 @@ gs_plugins_flatpak_app_with_runtime_func (GsPluginLoader *plugin_loader)
 
        /* remove the remote */
        g_object_unref (plugin_job);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REMOVE_REPO,
-                                        "app", app_source,
-                                        NULL);
+       plugin_job = gs_plugin_job_manage_repository_new (app_source, 
GS_PLUGIN_MANAGE_REPOSITORY_FLAGS_REMOVE);
        ret = gs_plugin_loader_job_action (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
@@ -627,9 +621,7 @@ gs_plugins_flatpak_app_missing_runtime_func (GsPluginLoader *plugin_loader)
 
        /* remove the remote */
        g_object_unref (plugin_job);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REMOVE_REPO,
-                                        "app", app_source,
-                                        NULL);
+       plugin_job = gs_plugin_job_manage_repository_new (app_source, 
GS_PLUGIN_MANAGE_REPOSITORY_FLAGS_REMOVE);
        ret = gs_plugin_loader_job_action (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
@@ -802,9 +794,7 @@ gs_plugins_flatpak_runtime_repo_func (GsPluginLoader *plugin_loader)
        g_assert_true (app_source != NULL);
        g_assert_cmpstr (gs_app_get_unique_id (app_source), ==, "user/flatpak/*/test/*");
        g_object_unref (plugin_job);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REMOVE_REPO,
-                                        "app", app_source,
-                                        NULL);
+       plugin_job = gs_plugin_job_manage_repository_new (app_source, 
GS_PLUGIN_MANAGE_REPOSITORY_FLAGS_REMOVE);
        ret = gs_plugin_loader_job_action (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
@@ -961,9 +951,7 @@ gs_plugins_flatpak_runtime_repo_redundant_func (GsPluginLoader *plugin_loader)
        g_assert_true (app_source != NULL);
        g_assert_cmpstr (gs_app_get_unique_id (app_source), ==, "user/flatpak/*/test/*");
        g_object_unref (plugin_job);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REMOVE_REPO,
-                                        "app", app_source,
-                                        NULL);
+       plugin_job = gs_plugin_job_manage_repository_new (app_source, 
GS_PLUGIN_MANAGE_REPOSITORY_FLAGS_REMOVE);
        ret = gs_plugin_loader_job_action (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
@@ -1052,9 +1040,7 @@ gs_plugins_flatpak_broken_remote_func (GsPluginLoader *plugin_loader)
 
        /* remove source */
        g_object_unref (plugin_job);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REMOVE_REPO,
-                                        "app", app_source,
-                                        NULL);
+       plugin_job = gs_plugin_job_manage_repository_new (app_source, 
GS_PLUGIN_MANAGE_REPOSITORY_FLAGS_REMOVE);
        ret = gs_plugin_loader_job_action (plugin_loader, plugin_job, NULL, &error);
        g_assert_no_error (error);
        g_assert_true (ret);
@@ -1289,9 +1275,7 @@ flatpak_bundle_or_ref_helper (GsPluginLoader *plugin_loader,
 
        /* remove source */
        g_object_unref (plugin_job);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REMOVE_REPO,
-                                        "app", app_source,
-                                        NULL);
+       plugin_job = gs_plugin_job_manage_repository_new (app_source, 
GS_PLUGIN_MANAGE_REPOSITORY_FLAGS_REMOVE);
        ret = gs_plugin_loader_job_action (plugin_loader, plugin_job, NULL, &error);
        g_assert_no_error (error);
        g_assert_true (ret);
@@ -1304,9 +1288,7 @@ flatpak_bundle_or_ref_helper (GsPluginLoader *plugin_loader,
                gs_app_set_management_plugin (runtime_source, plugin);
                gs_app_set_state (runtime_source, GS_APP_STATE_INSTALLED);
                g_object_unref (plugin_job);
-               plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REMOVE_REPO,
-                                                "app", runtime_source,
-                                                NULL);
+               plugin_job = gs_plugin_job_manage_repository_new (runtime_source, 
GS_PLUGIN_MANAGE_REPOSITORY_FLAGS_REMOVE);
                ret = gs_plugin_loader_job_action (plugin_loader, plugin_job, NULL, &error);
                g_assert_no_error (error);
                g_assert_true (ret);
@@ -1593,9 +1575,7 @@ gs_plugins_flatpak_app_update_func (GsPluginLoader *plugin_loader)
 
        /* remove the remote */
        g_object_unref (plugin_job);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REMOVE_REPO,
-                                        "app", app_source,
-                                        NULL);
+       plugin_job = gs_plugin_job_manage_repository_new (app_source, 
GS_PLUGIN_MANAGE_REPOSITORY_FLAGS_REMOVE);
        ret = gs_plugin_loader_job_action (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
@@ -1853,9 +1833,7 @@ gs_plugins_flatpak_runtime_extension_func (GsPluginLoader *plugin_loader)
 
        /* remove the remote */
        g_object_unref (plugin_job);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REMOVE_REPO,
-                                        "app", app_source,
-                                        NULL);
+       plugin_job = gs_plugin_job_manage_repository_new (app_source, 
GS_PLUGIN_MANAGE_REPOSITORY_FLAGS_REMOVE);
        ret = gs_plugin_loader_job_action (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]