@@ -573,6 +573,8 @@ func Test_SearchPullRequests(t *testing.T) {
573
573
assert .Equal (t , "search_pull_requests" , tool .Name )
574
574
assert .NotEmpty (t , tool .Description )
575
575
assert .Contains (t , tool .InputSchema .Properties , "query" )
576
+ assert .Contains (t , tool .InputSchema .Properties , "owner" )
577
+ assert .Contains (t , tool .InputSchema .Properties , "repo" )
576
578
assert .Contains (t , tool .InputSchema .Properties , "sort" )
577
579
assert .Contains (t , tool .InputSchema .Properties , "order" )
578
580
assert .Contains (t , tool .InputSchema .Properties , "perPage" )
@@ -645,6 +647,83 @@ func Test_SearchPullRequests(t *testing.T) {
645
647
expectError : false ,
646
648
expectedResult : mockSearchResult ,
647
649
},
650
+ {
651
+ name : "pull request search with owner and repo parameters" ,
652
+ mockedClient : mock .NewMockedHTTPClient (
653
+ mock .WithRequestMatchHandler (
654
+ mock .GetSearchIssues ,
655
+ expectQueryParams (
656
+ t ,
657
+ map [string ]string {
658
+ "q" : "repo:test-owner/test-repo is:pr draft:false" ,
659
+ "sort" : "updated" ,
660
+ "order" : "asc" ,
661
+ "page" : "1" ,
662
+ "per_page" : "30" ,
663
+ },
664
+ ).andThen (
665
+ mockResponse (t , http .StatusOK , mockSearchResult ),
666
+ ),
667
+ ),
668
+ ),
669
+ requestArgs : map [string ]interface {}{
670
+ "query" : "draft:false" ,
671
+ "owner" : "test-owner" ,
672
+ "repo" : "test-repo" ,
673
+ "sort" : "updated" ,
674
+ "order" : "asc" ,
675
+ },
676
+ expectError : false ,
677
+ expectedResult : mockSearchResult ,
678
+ },
679
+ {
680
+ name : "pull request search with only owner parameter (should ignore it)" ,
681
+ mockedClient : mock .NewMockedHTTPClient (
682
+ mock .WithRequestMatchHandler (
683
+ mock .GetSearchIssues ,
684
+ expectQueryParams (
685
+ t ,
686
+ map [string ]string {
687
+ "q" : "is:pr feature" ,
688
+ "page" : "1" ,
689
+ "per_page" : "30" ,
690
+ },
691
+ ).andThen (
692
+ mockResponse (t , http .StatusOK , mockSearchResult ),
693
+ ),
694
+ ),
695
+ ),
696
+ requestArgs : map [string ]interface {}{
697
+ "query" : "feature" ,
698
+ "owner" : "test-owner" ,
699
+ },
700
+ expectError : false ,
701
+ expectedResult : mockSearchResult ,
702
+ },
703
+ {
704
+ name : "pull request search with only repo parameter (should ignore it)" ,
705
+ mockedClient : mock .NewMockedHTTPClient (
706
+ mock .WithRequestMatchHandler (
707
+ mock .GetSearchIssues ,
708
+ expectQueryParams (
709
+ t ,
710
+ map [string ]string {
711
+ "q" : "is:pr review-required" ,
712
+ "page" : "1" ,
713
+ "per_page" : "30" ,
714
+ },
715
+ ).andThen (
716
+ mockResponse (t , http .StatusOK , mockSearchResult ),
717
+ ),
718
+ ),
719
+ ),
720
+ requestArgs : map [string ]interface {}{
721
+ "query" : "review-required" ,
722
+ "repo" : "test-repo" ,
723
+ },
724
+ expectError : false ,
725
+ expectedResult : mockSearchResult ,
726
+ },
648
727
{
649
728
name : "pull request search with minimal parameters" ,
650
729
mockedClient : mock .NewMockedHTTPClient (
0 commit comments