@@ -2,7 +2,6 @@ package exp
22
33import (
44 "testing"
5- "time"
65
76 "github.com/stretchr/testify/assert"
87)
@@ -40,59 +39,6 @@ func TestGetNoProxy(t *testing.T) {
4039 }
4140}
4241
43- func TestGetApiRequestThreshold (t * testing.T ) {
44- type testCase struct {
45- title string
46- in string
47- out time.Duration
48- }
49-
50- cases := []testCase {
51- {
52- title : "default" ,
53- in : "" ,
54- out : DefaultMinRequestThresholdMinutes * time .Minute ,
55- },
56- {
57- title : "with incorrect value type, negative int" ,
58- in : "-1" ,
59- out : DefaultMinRequestThresholdMinutes * time .Minute ,
60- },
61- {
62- title : "with incorrect value type, too big int" ,
63- in : "99999999999999999999999999999999999999999999999999999999999999999999999" ,
64- out : DefaultMinRequestThresholdMinutes * time .Minute ,
65- },
66- {
67- title : "with incorrect value type, string" ,
68- in : "not a number" ,
69- out : DefaultMinRequestThresholdMinutes * time .Minute ,
70- },
71- {
72- title : "with incorrect value type, go time format" ,
73- in : "1h" ,
74- out : DefaultMinRequestThresholdMinutes * time .Minute ,
75- },
76- {
77- title : "overrule" ,
78- in : "5" ,
79- out : 5 * time .Minute ,
80- },
81- }
82-
83- for _ , c := range cases {
84- t .Run (c .title , func (t * testing.T ) {
85- ff := FeatureFlags {annotations : map [string ]string {
86- APIRequestThresholdKey : c .in ,
87- }}
88-
89- out := ff .GetAPIRequestThreshold ()
90-
91- assert .Equal (t , c .out , out )
92- })
93- }
94- }
95-
9642func TestGetIntWithDefault (t * testing.T ) {
9743 type testCase struct {
9844 title string
0 commit comments