@@ -713,7 +713,7 @@ func TestCollectTagFilters(t *testing.T) {
713
713
mockClient := & mocks.BaseClientAPI {}
714
714
mockClient .On ("GetRepositories" , mock .Anything , "" , mock .Anything ).Return (ManyRepositoriesResult , nil ).Once ()
715
715
mockClient .On ("GetRepositories" , mock .Anything , mock .Anything , mock .Anything ).Return (NoRepositoriesResult , nil ).Once ()
716
- filters , err := common .CollectTagFilters (testCtx , []string {".+:.*-?local[.].+" }, mockClient , 60 )
716
+ filters , err := common .CollectTagFilters (testCtx , []string {".+:.*-?local[.].+" }, mockClient , 60 , defaultRepoPageSize )
717
717
assert .Equal (4 , len (filters ), "Number of found should be 4" )
718
718
assert .Equal (".*-?local[.].+" , filters [testRepo ], "Filter for test repo should be .*-?local[.].+" )
719
719
assert .Equal (".*-?local[.].+" , filters ["bar" ], "Filter for bar repo should be .*-?local[.].+" )
@@ -726,7 +726,7 @@ func TestCollectTagFilters(t *testing.T) {
726
726
mockClient := & mocks.BaseClientAPI {}
727
727
mockClient .On ("GetRepositories" , mock .Anything , "" , mock .Anything ).Return (ManyRepositoriesResult , nil ).Once ()
728
728
mockClient .On ("GetRepositories" , mock .Anything , mock .Anything , mock .Anything ).Return (NoRepositoriesResult , nil ).Once ()
729
- filters , err := common .CollectTagFilters (testCtx , []string {".+:.*-?local\\ ..+" }, mockClient , 60 )
729
+ filters , err := common .CollectTagFilters (testCtx , []string {".+:.*-?local\\ ..+" }, mockClient , 60 , defaultRepoPageSize )
730
730
assert .Equal (4 , len (filters ), "Number of found should be 4" )
731
731
assert .Equal (".*-?local\\ ..+" , filters [testRepo ], "Filter for test repo should be .*-?local\\ ..+" )
732
732
assert .Equal (".*-?local\\ ..+" , filters ["bar" ], "Filter for bar repo should be .*-?local\\ ..+" )
@@ -739,7 +739,7 @@ func TestCollectTagFilters(t *testing.T) {
739
739
mockClient := & mocks.BaseClientAPI {}
740
740
mockClient .On ("GetRepositories" , mock .Anything , "" , mock .Anything ).Return (ManyRepositoriesResult , nil ).Once ()
741
741
mockClient .On ("GetRepositories" , mock .Anything , mock .Anything , mock .Anything ).Return (NoRepositoriesResult , nil ).Once ()
742
- filters , err := common .CollectTagFilters (testCtx , []string {testRepo + ":.*" }, mockClient , 60 )
742
+ filters , err := common .CollectTagFilters (testCtx , []string {testRepo + ":.*" }, mockClient , 60 , defaultRepoPageSize )
743
743
assert .Equal (1 , len (filters ), "Number of found should be one" )
744
744
assert .Equal (".*" , filters [testRepo ], "Filter for test repo should be .*" )
745
745
assert .Equal (nil , err , "Error should be nil" )
@@ -751,7 +751,7 @@ func TestCollectTagFilters(t *testing.T) {
751
751
mockClient := & mocks.BaseClientAPI {}
752
752
mockClient .On ("GetRepositories" , mock .Anything , "" , mock .Anything ).Return (ManyRepositoriesResult , nil ).Once ()
753
753
mockClient .On ("GetRepositories" , mock .Anything , mock .Anything , mock .Anything ).Return (NoRepositoriesResult , nil ).Once ()
754
- filters , err := common .CollectTagFilters (testCtx , []string {".*:.*" }, mockClient , 60 )
754
+ filters , err := common .CollectTagFilters (testCtx , []string {".*:.*" }, mockClient , 60 , defaultRepoPageSize )
755
755
assert .Equal (4 , len (filters ), "Number of found should be 4" )
756
756
assert .Equal (".*" , filters [testRepo ], "Filter for test repo should be .*" )
757
757
assert .Equal (".*" , filters ["bar" ], "Filter for bar repo should be .*" )
@@ -764,7 +764,7 @@ func TestCollectTagFilters(t *testing.T) {
764
764
mockClient := & mocks.BaseClientAPI {}
765
765
mockClient .On ("GetRepositories" , mock .Anything , "" , mock .Anything ).Return (ManyRepositoriesResult , nil ).Once ()
766
766
mockClient .On ("GetRepositories" , mock .Anything , mock .Anything , mock .Anything ).Return (NoRepositoriesResult , nil ).Once ()
767
- filters , err := common .CollectTagFilters (testCtx , []string {"ba:.*" }, mockClient , 60 )
767
+ filters , err := common .CollectTagFilters (testCtx , []string {"ba:.*" }, mockClient , 60 , defaultRepoPageSize )
768
768
assert .Equal (0 , len (filters ), "Number of found repos should be zero" )
769
769
assert .Equal (nil , err , "Error should be nil" )
770
770
mockClient .AssertExpectations (t )
@@ -775,7 +775,7 @@ func TestCollectTagFilters(t *testing.T) {
775
775
mockClient := & mocks.BaseClientAPI {}
776
776
mockClient .On ("GetRepositories" , mock .Anything , "" , mock .Anything ).Return (ManyRepositoriesResult , nil ).Once ()
777
777
mockClient .On ("GetRepositories" , mock .Anything , mock .Anything , mock .Anything ).Return (NoRepositoriesResult , nil ).Once ()
778
- filters , err := common .CollectTagFilters (testCtx , []string {"foo/bar:.*" }, mockClient , 60 )
778
+ filters , err := common .CollectTagFilters (testCtx , []string {"foo/bar:.*" }, mockClient , 60 , defaultRepoPageSize )
779
779
assert .Equal (1 , len (filters ), "Number of found repos should be one" )
780
780
assert .Equal (nil , err , "Error should be nil" )
781
781
mockClient .AssertExpectations (t )
@@ -786,7 +786,7 @@ func TestCollectTagFilters(t *testing.T) {
786
786
mockClient := & mocks.BaseClientAPI {}
787
787
mockClient .On ("GetRepositories" , mock .Anything , "" , mock .Anything ).Return (ManyRepositoriesResult , nil ).Once ()
788
788
mockClient .On ("GetRepositories" , mock .Anything , mock .Anything , mock .Anything ).Return (NoRepositoriesResult , nil ).Once ()
789
- filters , err := common .CollectTagFilters (testCtx , []string {"foo/bar:(?:.*)" }, mockClient , 60 )
789
+ filters , err := common .CollectTagFilters (testCtx , []string {"foo/bar:(?:.*)" }, mockClient , 60 , defaultRepoPageSize )
790
790
assert .Equal (1 , len (filters ), "Number of found repos should be one" )
791
791
assert .Equal (nil , err , "Error should be nil" )
792
792
mockClient .AssertExpectations (t )
@@ -797,7 +797,7 @@ func TestCollectTagFilters(t *testing.T) {
797
797
mockClient := & mocks.BaseClientAPI {}
798
798
mockClient .On ("GetRepositories" , mock .Anything , "" , mock .Anything ).Return (ManyRepositoriesResult , nil ).Once ()
799
799
mockClient .On ("GetRepositories" , mock .Anything , mock .Anything , mock .Anything ).Return (NoRepositoriesResult , nil ).Once ()
800
- filters , err := common .CollectTagFilters (testCtx , []string {"foo/bar(?:.*):(?:.*)" }, mockClient , 60 )
800
+ filters , err := common .CollectTagFilters (testCtx , []string {"foo/bar(?:.*):(?:.*)" }, mockClient , 60 , defaultRepoPageSize )
801
801
assert .Equal (1 , len (filters ), "Number of found repos should be one" )
802
802
assert .Equal (nil , err , "Error should be nil" )
803
803
mockClient .AssertExpectations (t )
@@ -808,7 +808,7 @@ func TestCollectTagFilters(t *testing.T) {
808
808
mockClient := & mocks.BaseClientAPI {}
809
809
mockClient .On ("GetRepositories" , mock .Anything , "" , mock .Anything ).Return (ManyRepositoriesResult , nil ).Once ()
810
810
mockClient .On ("GetRepositories" , mock .Anything , mock .Anything , mock .Anything ).Return (NoRepositoriesResult , nil ).Once ()
811
- filters , err := common .CollectTagFilters (testCtx , []string {"foo/bar(?:.*)?:(?:.*)" }, mockClient , 60 )
811
+ filters , err := common .CollectTagFilters (testCtx , []string {"foo/bar(?:.*)?:(?:.*)" }, mockClient , 60 , defaultRepoPageSize )
812
812
assert .Equal (1 , len (filters ), "Number of found repos should be one" )
813
813
assert .Equal (nil , err , "Error should be nil" )
814
814
mockClient .AssertExpectations (t )
@@ -819,7 +819,7 @@ func TestCollectTagFilters(t *testing.T) {
819
819
mockClient := & mocks.BaseClientAPI {}
820
820
mockClient .On ("GetRepositories" , mock .Anything , "" , mock .Anything ).Return (ManyRepositoriesResult , nil ).Once ()
821
821
mockClient .On ("GetRepositories" , mock .Anything , mock .Anything , mock .Anything ).Return (NoRepositoriesResult , nil ).Once ()
822
- filters , err := common .CollectTagFilters (testCtx , []string {"foo/bar(?:.*):.(?:.*)" }, mockClient , 60 )
822
+ filters , err := common .CollectTagFilters (testCtx , []string {"foo/bar(?:.*):.(?:.*)" }, mockClient , 60 , defaultRepoPageSize )
823
823
assert .Equal (1 , len (filters ), "Number of found repos should be one" )
824
824
assert .Equal (nil , err , "Error should be nil" )
825
825
mockClient .AssertExpectations (t )
@@ -830,7 +830,7 @@ func TestCollectTagFilters(t *testing.T) {
830
830
mockClient := & mocks.BaseClientAPI {}
831
831
mockClient .On ("GetRepositories" , mock .Anything , "" , mock .Anything ).Return (ManyRepositoriesResult , nil ).Once ()
832
832
mockClient .On ("GetRepositories" , mock .Anything , mock .Anything , mock .Anything ).Return (NoRepositoriesResult , nil ).Once ()
833
- filters , err := common .CollectTagFilters (testCtx , []string {"foo/b[[:alpha:]]r(?:.*):.(?:.*)" }, mockClient , 60 )
833
+ filters , err := common .CollectTagFilters (testCtx , []string {"foo/b[[:alpha:]]r(?:.*):.(?:.*)" }, mockClient , 60 , defaultRepoPageSize )
834
834
assert .Equal (1 , len (filters ), "Number of found repos should be one" )
835
835
assert .Equal (nil , err , "Error should be nil" )
836
836
mockClient .AssertExpectations (t )
@@ -840,7 +840,7 @@ func TestCollectTagFilters(t *testing.T) {
840
840
assert := assert .New (t )
841
841
mockClient := & mocks.BaseClientAPI {}
842
842
mockClient .On ("GetRepositories" , mock .Anything , "" , mock .Anything ).Return (NoRepositoriesResult , nil ).Once ()
843
- filters , err := common .CollectTagFilters (testCtx , []string {testRepo + ":.*" }, mockClient , 60 )
843
+ filters , err := common .CollectTagFilters (testCtx , []string {testRepo + ":.*" }, mockClient , 60 , defaultRepoPageSize )
844
844
assert .Equal (0 , len (filters ), "Number of found repos should be zero" )
845
845
assert .Equal (nil , err , "Error should be nil" )
846
846
mockClient .AssertExpectations (t )
@@ -851,7 +851,7 @@ func TestCollectTagFilters(t *testing.T) {
851
851
mockClient := & mocks.BaseClientAPI {}
852
852
mockClient .On ("GetRepositories" , mock .Anything , "" , mock .Anything ).Return (ManyRepositoriesResult , nil ).Once ()
853
853
mockClient .On ("GetRepositories" , mock .Anything , mock .Anything , mock .Anything ).Return (NoRepositoriesResult , nil ).Once ()
854
- _ , err := common .CollectTagFilters (testCtx , []string {":.*" }, mockClient , 60 )
854
+ _ , err := common .CollectTagFilters (testCtx , []string {":.*" }, mockClient , 60 , defaultRepoPageSize )
855
855
assert .NotEqual (nil , err , "Error should not be nil" )
856
856
mockClient .AssertExpectations (t )
857
857
})
@@ -861,7 +861,7 @@ func TestCollectTagFilters(t *testing.T) {
861
861
mockClient := & mocks.BaseClientAPI {}
862
862
mockClient .On ("GetRepositories" , mock .Anything , "" , mock .Anything ).Return (ManyRepositoriesResult , nil ).Once ()
863
863
mockClient .On ("GetRepositories" , mock .Anything , mock .Anything , mock .Anything ).Return (NoRepositoriesResult , nil ).Once ()
864
- _ , err := common .CollectTagFilters (testCtx , []string {testRepo + ".*:" }, mockClient , 60 )
864
+ _ , err := common .CollectTagFilters (testCtx , []string {testRepo + ".*:" }, mockClient , 60 , defaultRepoPageSize )
865
865
assert .NotEqual (nil , err , "Error should not be nil" )
866
866
mockClient .AssertExpectations (t )
867
867
})
@@ -873,7 +873,7 @@ func TestGetAllRepositoryNames(t *testing.T) {
873
873
mockClient := & mocks.BaseClientAPI {}
874
874
mockClient .On ("GetRepositories" , mock .Anything , "" , mock .Anything ).Return (ManyRepositoriesResult , nil ).Once ()
875
875
mockClient .On ("GetRepositories" , mock .Anything , mock .Anything , mock .Anything ).Return (NoRepositoriesResult , nil ).Once ()
876
- allRepoNames , err := common .GetAllRepositoryNames (testCtx , mockClient )
876
+ allRepoNames , err := common .GetAllRepositoryNames (testCtx , mockClient , defaultRepoPageSize )
877
877
assert .Equal (4 , len (allRepoNames ), "Number of all repo names should be 4" )
878
878
assert .Equal (nil , err , "Error should be nil" )
879
879
mockClient .AssertExpectations (t )
@@ -885,7 +885,7 @@ func TestGetAllRepositoryNames(t *testing.T) {
885
885
mockClient .On ("GetRepositories" , mock .Anything , "" , mock .Anything ).Return (ManyRepositoriesResult , nil ).Once ()
886
886
mockClient .On ("GetRepositories" , mock .Anything , mock .Anything , mock .Anything ).Return (MoreRepositoriesResult , nil ).Once ()
887
887
mockClient .On ("GetRepositories" , mock .Anything , mock .Anything , mock .Anything ).Return (NoRepositoriesResult , nil ).Once ()
888
- allRepoNames , err := common .GetAllRepositoryNames (testCtx , mockClient )
888
+ allRepoNames , err := common .GetAllRepositoryNames (testCtx , mockClient , defaultRepoPageSize )
889
889
assert .Equal (7 , len (allRepoNames ), "Number of all repo names should be 7" )
890
890
assert .Equal (nil , err , "Error should be nil" )
891
891
mockClient .AssertExpectations (t )
@@ -895,7 +895,7 @@ func TestGetAllRepositoryNames(t *testing.T) {
895
895
assert := assert .New (t )
896
896
mockClient := & mocks.BaseClientAPI {}
897
897
mockClient .On ("GetRepositories" , mock .Anything , "" , mock .Anything ).Return (NoRepositoriesResult , nil ).Once ()
898
- allRepoNames , err := common .GetAllRepositoryNames (testCtx , mockClient )
898
+ allRepoNames , err := common .GetAllRepositoryNames (testCtx , mockClient , defaultRepoPageSize )
899
899
assert .Equal (0 , len (allRepoNames ), "Number of all repo names should be 7" )
900
900
assert .Equal (nil , err , "Error should be nil" )
901
901
mockClient .AssertExpectations (t )
0 commit comments