@@ -747,7 +747,7 @@ def test_assign_user_remove_all(self, mock_client):
747747 mock_client .search_users .assert_not_called ()
748748
749749 def common_test_create_jira_issue (
750- self , mock_attach_link , mock_client , mockupdate_jira_issue
750+ self , mock_attach_link , mock_client , mock_update_jira_issue
751751 ):
752752 """Common code for testing _create_jira_issue"""
753753
@@ -782,7 +782,7 @@ def common_test_create_jira_issue(
782782 self .mock_downstream ,
783783 {"url" : "mock_url" , "title" : "Upstream issue" },
784784 )
785- mockupdate_jira_issue .assert_called_with (
785+ mock_update_jira_issue .assert_called_with (
786786 self .mock_downstream , self .mock_issue , mock_client , self .mock_config
787787 )
788788 self .mock_downstream .update .assert_any_call ({"customfield_1" : "DUMMY-1234" })
@@ -798,13 +798,13 @@ def common_test_create_jira_issue(
798798 @mock .patch (PATH + "attach_link" )
799799 @mock .patch ("jira.client.JIRA" )
800800 def test_create_jira_issue (
801- self , mock_client , mock_attach_link , mockupdate_jira_issue
801+ self , mock_client , mock_attach_link , mock_update_jira_issue
802802 ):
803803 """
804804 Tests '_create_jira_issue' function normal success case
805805 """
806806 self .common_test_create_jira_issue (
807- mock_attach_link , mock_client , mockupdate_jira_issue
807+ mock_attach_link , mock_client , mock_update_jira_issue
808808 )
809809
810810 mock_client .add_comment .assert_not_called ()
@@ -813,7 +813,7 @@ def test_create_jira_issue(
813813 @mock .patch (PATH + "attach_link" )
814814 @mock .patch ("jira.client.JIRA" )
815815 def test_create_jira_issue_failed_epic_link (
816- self , mock_client , mock_attach_link , mockupdate_jira_issue
816+ self , mock_client , mock_attach_link , mock_update_jira_issue
817817 ):
818818 """
819819 Tests '_create_jira_issue' function when we fail while updating the epic link
@@ -822,7 +822,7 @@ def test_create_jira_issue_failed_epic_link(
822822 self .mock_downstream .update .side_effect = [JIRAError , "success" , "success" ]
823823
824824 self .common_test_create_jira_issue (
825- mock_attach_link , mock_client , mockupdate_jira_issue
825+ mock_attach_link , mock_client , mock_update_jira_issue
826826 )
827827
828828 mock_client .add_comment .assert_called_with (
@@ -833,7 +833,7 @@ def test_create_jira_issue_failed_epic_link(
833833 @mock .patch (PATH + "attach_link" )
834834 @mock .patch ("jira.client.JIRA" )
835835 def test_create_jira_issue_failed_exd_service (
836- self , mock_client , mock_attach_link , mockupdate_jira_issue
836+ self , mock_client , mock_attach_link , mock_update_jira_issue
837837 ):
838838 """
839839 Tests '_create_jira_issue' function when we fail while updating the
@@ -843,7 +843,7 @@ def test_create_jira_issue_failed_exd_service(
843843 self .mock_downstream .update .side_effect = ["success" , "success" , JIRAError ]
844844
845845 self .common_test_create_jira_issue (
846- mock_attach_link , mock_client , mockupdate_jira_issue
846+ mock_attach_link , mock_client , mock_update_jira_issue
847847 )
848848
849849 mock_client .add_comment .assert_called_with (
@@ -862,7 +862,7 @@ def test_create_jira_issue_multiple_types(
862862 mock_client ,
863863 mock_get_preferred_issue_types ,
864864 mock_attach_link ,
865- mockupdate_jira_issue ,
865+ mock_update_jira_issue ,
866866 ):
867867 """
868868 Tests '_create_jira_issue' function when multiple possible issue types are found
@@ -872,7 +872,7 @@ def test_create_jira_issue_multiple_types(
872872 mock_get_preferred_issue_types .return_value = issue_types
873873
874874 self .common_test_create_jira_issue (
875- mock_attach_link , mock_client , mockupdate_jira_issue
875+ mock_attach_link , mock_client , mock_update_jira_issue
876876 )
877877
878878 mock_client .add_comment .assert_called_with (
@@ -884,7 +884,7 @@ def test_create_jira_issue_multiple_types(
884884 @mock .patch (PATH + "attach_link" )
885885 @mock .patch ("jira.client.JIRA" )
886886 def test_create_jira_issue_no_updates (
887- self , mock_client , mock_attach_link , mockupdate_jira_issue
887+ self , mock_client , mock_attach_link , mock_update_jira_issue
888888 ):
889889 """
890890 Tests '_create_jira_issue' function where we have
@@ -918,7 +918,7 @@ def test_create_jira_issue_no_updates(
918918 self .mock_downstream ,
919919 {"url" : "mock_url" , "title" : "Upstream issue" },
920920 )
921- mockupdate_jira_issue .assert_called_with (
921+ mock_update_jira_issue .assert_called_with (
922922 self .mock_downstream , self .mock_issue , mock_client , self .mock_config
923923 )
924924 self .assertEqual (response , self .mock_downstream )
@@ -1014,7 +1014,7 @@ def test_sync_with_jira_matching(
10141014 mock_existing_jira_issue_legacy ,
10151015 mock_client ,
10161016 mock_create_jira_issue ,
1017- mockupdate_jira_issue ,
1017+ mock_update_jira_issue ,
10181018 mock_existing_jira_issue ,
10191019 mock_get_jira_client ,
10201020 ):
@@ -1032,7 +1032,7 @@ def test_sync_with_jira_matching(
10321032
10331033 # Assert all calls were made correctly
10341034 mock_get_jira_client .assert_called_with (self .mock_issue , self .mock_config )
1035- mockupdate_jira_issue .assert_called_with (
1035+ mock_update_jira_issue .assert_called_with (
10361036 self .mock_downstream , self .mock_issue , mock_client , self .mock_config
10371037 )
10381038 mock_create_jira_issue .assert_not_called ()
@@ -1051,7 +1051,7 @@ def test_sync_with_jira_down(
10511051 mock_existing_jira_issue_legacy ,
10521052 mock_client ,
10531053 mock_create_jira_issue ,
1054- mockupdate_jira_issue ,
1054+ mock_update_jira_issue ,
10551055 mock_existing_jira_issue ,
10561056 mock_get_jira_client ,
10571057 ):
@@ -1069,7 +1069,7 @@ def test_sync_with_jira_down(
10691069
10701070 # Assert all calls were made correctly
10711071 mock_get_jira_client .assert_called_with (self .mock_issue , self .mock_config )
1072- mockupdate_jira_issue .assert_not_called ()
1072+ mock_update_jira_issue .assert_not_called ()
10731073 mock_create_jira_issue .assert_not_called ()
10741074 mock_existing_jira_issue_legacy .assert_not_called ()
10751075
@@ -1086,7 +1086,7 @@ def test_sync_with_jira_no_matching(
10861086 mock_existing_jira_issue_legacy ,
10871087 mock_client ,
10881088 mock_create_jira_issue ,
1089- mockupdate_jira_issue ,
1089+ mock_update_jira_issue ,
10901090 mock_existing_jira_issue ,
10911091 mock_get_jira_client ,
10921092 ):
@@ -1104,7 +1104,7 @@ def test_sync_with_jira_no_matching(
11041104
11051105 # Assert all calls were made correctly
11061106 mock_get_jira_client .assert_called_with (self .mock_issue , self .mock_config )
1107- mockupdate_jira_issue .assert_not_called ()
1107+ mock_update_jira_issue .assert_not_called ()
11081108 mock_create_jira_issue .assert_called_with (
11091109 mock_client , self .mock_issue , self .mock_config
11101110 )
@@ -1113,15 +1113,14 @@ def test_sync_with_jira_no_matching(
11131113 @mock .patch (PATH + "convert_content" )
11141114 def test_maybe_convert_markdown (self , mock_convert ):
11151115 """maybe_convert_markdown: converts when opted-in, skips otherwise."""
1116- mock_convert .return_value = "h1. Hello"
11171116
11181117 # Converts when source=github, content non-empty, github_markdown in updates
1118+ mock_convert .return_value = "h1. Hello"
11191119 issue = MagicMock ()
11201120 issue .downstream = {"issue_updates" : ["description" , "github_markdown" ]}
11211121 issue .source = "github"
11221122 issue .content = "# Hello"
11231123 d .maybe_convert_markdown (issue )
1124- mock_convert .assert_called_once_with ("# Hello" )
11251124 self .assertEqual (issue .content , "h1. Hello" )
11261125
11271126 # Works with pr_updates key
@@ -1130,23 +1129,28 @@ def test_maybe_convert_markdown(self, mock_convert):
11301129 issue .downstream = {"pr_updates" : ["github_markdown" , "description" ]}
11311130 issue .content = "**bold**"
11321131 d .maybe_convert_markdown (issue , "pr_updates" )
1133- mock_convert .assert_called_once_with ("**bold**" )
11341132 self .assertEqual (issue .content , "*bold*" )
11351133
11361134 # Skips when github_markdown not in updates
11371135 mock_convert .reset_mock ()
11381136 issue .downstream = {"issue_updates" : ["description" ]}
11391137 issue .content = "# Hello"
11401138 d .maybe_convert_markdown (issue )
1141- mock_convert .assert_not_called ()
11421139 self .assertEqual (issue .content , "# Hello" )
11431140
11441141 # Skips when content is empty
11451142 mock_convert .reset_mock ()
11461143 issue .downstream = {"issue_updates" : ["github_markdown" ]}
11471144 issue .content = ""
11481145 d .maybe_convert_markdown (issue )
1149- mock_convert .assert_not_called ()
1146+ self .assertEqual (issue .content , "" )
1147+
1148+ # Skips when source is not github
1149+ issue .source = "pagure"
1150+ issue .downstream = {"issue_updates" : ["github_markdown" ]}
1151+ issue .content = "# Hello"
1152+ d .maybe_convert_markdown (issue )
1153+ self .assertEqual (issue .content , "# Hello" )
11501154
11511155 @mock .patch (PATH + "pypandoc" )
11521156 def test_convert_content (self , mock_pypandoc ):
@@ -1200,7 +1204,7 @@ def test_convert_content(self, mock_pypandoc):
12001204 @mock .patch (PATH + "_update_assignee" )
12011205 @mock .patch (PATH + "_update_on_close" )
12021206 @mock .patch ("jira.client.JIRA" )
1203- def testupdate_jira_issue_closed (
1207+ def test_update_jira_issue_closed (
12041208 self ,
12051209 mock_client ,
12061210 mock_update_on_close ,
@@ -1261,7 +1265,7 @@ def testupdate_jira_issue_closed(
12611265 @mock .patch (PATH + "_update_assignee" )
12621266 @mock .patch (PATH + "_update_on_close" )
12631267 @mock .patch ("jira.client.JIRA" )
1264- def testupdate_jira_issue_open (
1268+ def test_update_jira_issue_open (
12651269 self ,
12661270 mock_client ,
12671271 mock_update_on_close ,
@@ -2377,7 +2381,7 @@ def test_get_field_id_by_name_exception(self):
23772381 @mock .patch (PATH + "attach_link" )
23782382 @mock .patch ("jira.client.JIRA" )
23792383 def test_create_jira_issue_epic_link_field_not_found (
2380- self , mock_client , mock_attach_link , mockupdate_jira_issue
2384+ self , mock_client , mock_attach_link , mock_update_jira_issue
23812385 ):
23822386 """Test _create_jira_issue when Epic Link field cannot be resolved"""
23832387 # Set up return values
@@ -2439,7 +2443,7 @@ def test_update_github_project_fields_storypoints_resolution_failure(
24392443 @mock .patch (PATH + "change_status" )
24402444 @mock .patch ("jira.client.JIRA" )
24412445 def test_create_jira_issue_with_component_and_labels (
2442- self , mock_client , mock_change_status , mock_attach_link , mockupdate_jira_issue
2446+ self , mock_client , mock_change_status , mock_attach_link , mock_update_jira_issue
24432447 ):
24442448 """Test _create_jira_issue with component and labels"""
24452449 # Clear cache first
@@ -2474,7 +2478,7 @@ def test_create_jira_issue_with_component_and_labels(
24742478 @mock .patch (PATH + "change_status" )
24752479 @mock .patch ("jira.client.JIRA" )
24762480 def test_create_jira_issue_with_default_status_and_upstream_id (
2477- self , mock_client , mock_change_status , mock_attach_link , mockupdate_jira_issue
2481+ self , mock_client , mock_change_status , mock_attach_link , mock_update_jira_issue
24782482 ):
24792483 """Test _create_jira_issue with default_status and upstream_id comment"""
24802484 # Clear cache first
@@ -2668,7 +2672,7 @@ def test_UrlCache(self):
26682672 @mock .patch (PATH + "_update_assignee" )
26692673 @mock .patch (PATH + "_update_on_close" )
26702674 @mock .patch ("jira.client.JIRA" )
2671- def testupdate_jira_issue_github_project_fields_early_exit (
2675+ def test_update_jira_issue_github_project_fields_early_exit (
26722676 self ,
26732677 mock_client ,
26742678 mock_update_on_close ,
0 commit comments