@@ -288,6 +288,16 @@ def test_downstream_koji_build_failure_no_issue():
288
288
get_web_url = lambda : "https://src.fedoraproject.org/rpms/buildah" ,
289
289
default_branch = "main" ,
290
290
)
291
+ flexmock (PagureProject ).should_receive ("get_pr_list" ).and_return (
292
+ [
293
+ flexmock (
294
+ id = 5 ,
295
+ author = "author" ,
296
+ head_commit = "not-the-same-commit-hash" ,
297
+ status = PRStatus .open ,
298
+ )
299
+ ]
300
+ )
291
301
pagure_project_mock .should_receive ("get_files" ).with_args (
292
302
ref = "main" , filter_regex = r".+\.spec$"
293
303
).and_return (["buildah.spec" ])
@@ -377,6 +387,16 @@ def test_downstream_koji_build_failure_issue_created():
377
387
get_web_url = lambda : "https://src.fedoraproject.org/rpms/buildah" ,
378
388
default_branch = "main" ,
379
389
)
390
+ flexmock (PagureProject ).should_receive ("get_pr_list" ).and_return (
391
+ [
392
+ flexmock (
393
+ id = 5 ,
394
+ author = "author" ,
395
+ head_commit = "not-the-same-commit-hash" ,
396
+ status = PRStatus .open ,
397
+ )
398
+ ]
399
+ )
380
400
pagure_project_mock .should_receive ("get_files" ).with_args (
381
401
ref = "main" , filter_regex = r".+\.spec$"
382
402
).and_return (["buildah.spec" ])
@@ -472,6 +492,16 @@ def test_downstream_koji_build_failure_issue_comment():
472
492
get_web_url = lambda : "https://src.fedoraproject.org/rpms/buildah" ,
473
493
default_branch = "main" ,
474
494
)
495
+ flexmock (PagureProject ).should_receive ("get_pr_list" ).and_return (
496
+ [
497
+ flexmock (
498
+ id = 5 ,
499
+ author = "author" ,
500
+ head_commit = "not-the-same-commit-hash" ,
501
+ status = PRStatus .open ,
502
+ )
503
+ ]
504
+ )
475
505
pagure_project_mock .should_receive ("get_files" ).with_args (
476
506
ref = "main" , filter_regex = r".+\.spec$"
477
507
).and_return (["buildah.spec" ])
@@ -570,6 +600,16 @@ def test_downstream_koji_build_no_config():
570
600
get_web_url = lambda : "https://src.fedoraproject.org/rpms/buildah" ,
571
601
default_branch = "main" ,
572
602
)
603
+ flexmock (PagureProject ).should_receive ("get_pr_list" ).and_return (
604
+ [
605
+ flexmock (
606
+ id = 5 ,
607
+ author = "author" ,
608
+ head_commit = "not-the-same-commit-hash" ,
609
+ status = PRStatus .open ,
610
+ )
611
+ ]
612
+ )
573
613
pagure_project .should_receive ("get_files" ).with_args (
574
614
ref = "main" , filter_regex = r".+\.spec$"
575
615
).and_return (["buildah.spec" ])
@@ -642,6 +682,16 @@ def test_downstream_koji_build_where_multiple_branches_defined(jobs_config):
642
682
f"'jobs': { jobs_config } ,"
643
683
"'downstream_package_name': 'buildah'}"
644
684
)
685
+ flexmock (PagureProject ).should_receive ("get_pr_list" ).and_return (
686
+ [
687
+ flexmock (
688
+ id = 5 ,
689
+ author = "author" ,
690
+ head_commit = "not-the-same-commit-hash" ,
691
+ status = PRStatus .open ,
692
+ )
693
+ ]
694
+ )
645
695
pagure_project = flexmock (
646
696
PagureProject ,
647
697
full_repo_name = "rpms/buildah" ,
@@ -817,6 +867,16 @@ def test_precheck_koji_build_push(
817
867
distgit_push_event , push_username , allowed_committers , should_pass
818
868
):
819
869
distgit_push_event .committer = push_username
870
+ flexmock (PagureProject ).should_receive ("get_pr_list" ).and_return (
871
+ [
872
+ flexmock (
873
+ id = 5 ,
874
+ author = "author" ,
875
+ head_commit = "not-the-same-commit-hash" ,
876
+ status = PRStatus .open ,
877
+ )
878
+ ]
879
+ )
820
880
821
881
flexmock (GitProjectModel ).should_receive ("get_or_create" ).with_args (
822
882
namespace = "rpms" ,
@@ -884,8 +944,6 @@ def test_precheck_koji_build_push_pr(
884
944
allowed_pr_authors ,
885
945
should_pass ,
886
946
):
887
- distgit_push_event .committer = "pagure"
888
-
889
947
flexmock (GitProjectModel ).should_receive ("get_or_create" ).with_args (
890
948
namespace = "rpms" ,
891
949
project_url = "https://src.fedoraproject.org/rpms/packit" ,
0 commit comments