| |
@@ -24,6 +24,8 @@
|
| |
"pdc_config": {
|
| |
"server": "https://pdc.fedoraproject.org/rest_api/v1",
|
| |
},
|
| |
+ "pagure_api_key": "some api key",
|
| |
+ "pagure_url": "https://src.fedoraproject.org",
|
| |
# distgit_bugzilla_sync config values
|
| |
"ignorable_accounts": [],
|
| |
"fasjson": False,
|
| |
@@ -95,6 +97,8 @@
|
| |
)
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.fedora_account")
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.bugzilla_system")
|
| |
+ @patch("toddlers.plugins.distgit_bugzilla_sync.pagure.set_pagure")
|
| |
+ @patch("toddlers.utils.bodhi.set_bodhi")
|
| |
@patch("toml.load")
|
| |
def test_process_dry_run_edit_project(
|
| |
self,
|
| |
@@ -370,6 +374,8 @@
|
| |
)
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.fedora_account")
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.bugzilla_system")
|
| |
+ @patch("toddlers.plugins.distgit_bugzilla_sync.pagure.set_pagure")
|
| |
+ @patch("toddlers.utils.bodhi.set_bodhi")
|
| |
@patch("toml.load")
|
| |
def test_process_dry_run_specific_project(
|
| |
self,
|
| |
@@ -493,6 +499,8 @@
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.fedora_account")
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.bugzilla_system")
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.notify")
|
| |
+ @patch("toddlers.plugins.distgit_bugzilla_sync.pagure.set_pagure")
|
| |
+ @patch("toddlers.utils.bodhi.set_bodhi")
|
| |
@patch("toml.load")
|
| |
def test_process_report_protocol_error(
|
| |
self,
|
| |
@@ -606,6 +614,8 @@
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.fedora_account")
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.bugzilla_system")
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.notify")
|
| |
+ @patch("toddlers.plugins.distgit_bugzilla_sync.pagure.set_pagure")
|
| |
+ @patch("toddlers.utils.bodhi.set_bodhi")
|
| |
@patch("toml.load")
|
| |
def test_process_report_client_error(
|
| |
self,
|
| |
@@ -739,6 +749,8 @@
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.fedora_account")
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.bugzilla_system")
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.notify")
|
| |
+ @patch("toddlers.plugins.distgit_bugzilla_sync.pagure.set_pagure")
|
| |
+ @patch("toddlers.utils.bodhi.set_bodhi")
|
| |
@patch("toml.load")
|
| |
def test_process_report_missing_mails(
|
| |
self,
|
| |
@@ -835,6 +847,8 @@
|
| |
)
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.fedora_account")
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.bugzilla_system")
|
| |
+ @patch("toddlers.plugins.distgit_bugzilla_sync.pagure.set_pagure")
|
| |
+ @patch("toddlers.utils.bodhi.set_bodhi")
|
| |
@patch("toml.load")
|
| |
def test_process_dry_run_verbose(
|
| |
self,
|
| |
@@ -932,6 +946,8 @@
|
| |
)
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.fedora_account")
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.bugzilla_system")
|
| |
+ @patch("toddlers.plugins.distgit_bugzilla_sync.pagure.set_pagure")
|
| |
+ @patch("toddlers.utils.bodhi.set_bodhi")
|
| |
@patch("toml.load")
|
| |
def test_process_missing_namespace(
|
| |
self,
|
| |
@@ -984,6 +1000,8 @@
|
| |
)
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.fedora_account")
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.bugzilla_system")
|
| |
+ @patch("toddlers.plugins.distgit_bugzilla_sync.pagure.set_pagure")
|
| |
+ @patch("toddlers.utils.bodhi.set_bodhi")
|
| |
@patch("toml.load")
|
| |
def test_process_missing_pdc_branches(
|
| |
self,
|
| |
@@ -1041,6 +1059,8 @@
|
| |
@patch(
|
| |
"toddlers.plugins.distgit_bugzilla_sync.PackageSummaries.get_package_summaries"
|
| |
)
|
| |
+ @patch("toddlers.plugins.distgit_bugzilla_sync.pagure.set_pagure")
|
| |
+ @patch("toddlers.utils.bodhi.set_bodhi")
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.fedora_account")
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.bugzilla_system")
|
| |
@patch("toml.load")
|
| |
@@ -1157,6 +1177,8 @@
|
| |
@patch(
|
| |
"toddlers.plugins.distgit_bugzilla_sync.PackageSummaries.get_package_summaries"
|
| |
)
|
| |
+ @patch("toddlers.plugins.distgit_bugzilla_sync.pagure.set_pagure")
|
| |
+ @patch("toddlers.utils.bodhi.set_bodhi")
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.fedora_account")
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.bugzilla_system")
|
| |
@patch("toml.load")
|
| |
@@ -1165,6 +1187,10 @@
|
| |
mock_toml,
|
| |
mock_bugzilla,
|
| |
mock_fas,
|
| |
+ mock_dist_git,
|
| |
+ mock_set_pagure,
|
| |
+ mock_set_bodhi,
|
| |
+ mock_bodhi,
|
| |
mock_summaries,
|
| |
config,
|
| |
toddler,
|
| |
@@ -1179,6 +1205,23 @@
|
| |
# Mock package summaries response
|
| |
mock_summaries.return_value = {"foo": "Summary"}
|
| |
|
| |
+ mock_dist_git = MagicMock()
|
| |
+ mock_dist_git.get_retired_packages.side_effect = (
|
| |
+ ["package01", "package02"],
|
| |
+ ["package01", "package03"],
|
| |
+ )
|
| |
+ mock_dist_git.get_branches.return_value = ["f39", "f40"]
|
| |
+ mock_dist_git.get_project.return_value = {
|
| |
+ "user": {"name": "Gavriel Loken"},
|
| |
+ "access_users": {"admin": ["Fulgrim", "orphan"]},
|
| |
+ "access_groups": {"admin": ["Adeptus Astartes"]},
|
| |
+ }
|
| |
+ mock_set_pagure.return_value = mock_dist_git
|
| |
+ mock_bodhi = MagicMock()
|
| |
+ mock_bodhi.get_active_branches.return_value = ["f39", "f40"]
|
| |
+ mock_set_bodhi.return_value = mock_bodhi
|
| |
+
|
| |
+
|
| |
# Mock pagure responses
|
| |
toddler.requests_session = Mock()
|
| |
response_pagure_poc = MagicMock()
|
| |
@@ -1252,6 +1295,7 @@
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.bugzilla_system")
|
| |
@patch("toddlers.plugins.distgit_bugzilla_sync.notify")
|
| |
@patch("toml.load")
|
| |
+ @patch("toddlers.plugins.distgit_bugzilla_sync.pagure.set_pagure")
|
| |
def test_process_notify_user_cache_exists(
|
| |
self,
|
| |
mock_toml,
|
| |
Signed-off-by: Tomas Hrcka thrcka@redhat.com