@@ -720,6 +720,7 @@ def test_request_triggers_multiple_update_actions(
720
720
webhook_request_factory ,
721
721
mocked_bugzilla ,
722
722
mocked_jira ,
723
+ webhook_event_change_factory ,
723
724
):
724
725
actions = factories .ActionsFactory (
725
726
root = [
@@ -728,12 +729,20 @@ def test_request_triggers_multiple_update_actions(
728
729
bugzilla_user_id = "tbd" ,
729
730
description = "test config" ,
730
731
parameters__jira_project_key = "JBI" ,
732
+ parameters__steps__existing = ["maybe_update_issue_resolution" ],
733
+ parameters__resolution_map = {
734
+ "FIXED" : "Closed" ,
735
+ },
731
736
),
732
737
factories .ActionFactory (
733
738
whiteboard_tag = "other" ,
734
739
bugzilla_user_id = "tbd" ,
735
740
description = "test config" ,
736
741
parameters__jira_project_key = "DE" ,
742
+ parameters__steps__existing = ["maybe_update_issue_resolution" ],
743
+ parameters__resolution_map = {
744
+ "FIXED" : "Done" ,
745
+ },
737
746
),
738
747
]
739
748
)
@@ -744,6 +753,12 @@ def test_request_triggers_multiple_update_actions(
744
753
"https://mozilla.atlassian.net/browse/JBI-234" ,
745
754
"https://mozilla.atlassian.net/browse/DE-567" ,
746
755
],
756
+ bug__resolution = "FIXED" ,
757
+ event__changes = [
758
+ webhook_event_change_factory (
759
+ field = "resolution" , removed = "OPEN" , added = "FIXED"
760
+ )
761
+ ],
747
762
)
748
763
mocked_bugzilla .get_bug .return_value = webhook .bug
749
764
@@ -759,9 +774,21 @@ def side_effect_for_get_issue(issue_key):
759
774
760
775
details = execute_action (request = webhook , actions = actions )
761
776
777
+ mocked_jira .update_issue_field .assert_any_call (
778
+ key = "JBI-234" ,
779
+ fields = {
780
+ "resolution" : {"name" : "Closed" },
781
+ },
782
+ )
783
+ mocked_jira .update_issue_field .assert_any_call (
784
+ key = "DE-567" ,
785
+ fields = {
786
+ "resolution" : {"name" : "Done" },
787
+ },
788
+ )
789
+
762
790
# Details has the following shape:
763
791
# {'devtest': {'responses': [..]}, 'other': {'responses': [...]}}
764
792
assert len (actions ) == len (details )
765
793
assert "devtest" in details
766
794
assert "other" in details
767
- print (details )
0 commit comments