@@ -25,8 +25,10 @@ func TestRateLimits_String(t *testing.T) {
2525 CodeScanningUpload : & Rate {},
2626 ActionsRunnerRegistration : & Rate {},
2727 SCIM : & Rate {},
28+ DependencySnapshots : & Rate {},
29+ CodeSearch : & Rate {},
2830 }
29- want := `github.RateLimits{Core:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, Search:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, GraphQL:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, IntegrationManifest:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SourceImport:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, CodeScanningUpload:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, ActionsRunnerRegistration:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SCIM:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}}`
31+ want := `github.RateLimits{Core:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, Search:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, GraphQL:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, IntegrationManifest:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SourceImport:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, CodeScanningUpload:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, ActionsRunnerRegistration:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SCIM:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, DependencySnapshots:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, CodeSearch:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}}`
3032 if got := v .String (); got != want {
3133 t .Errorf ("RateLimits.String = %v, want %v" , got , want )
3234 }
@@ -46,7 +48,9 @@ func TestRateLimits(t *testing.T) {
4648 "source_import": {"limit":6,"remaining":5,"reset":1372700877},
4749 "code_scanning_upload": {"limit":7,"remaining":6,"reset":1372700878},
4850 "actions_runner_registration": {"limit":8,"remaining":7,"reset":1372700879},
49- "scim": {"limit":9,"remaining":8,"reset":1372700880}
51+ "scim": {"limit":9,"remaining":8,"reset":1372700880},
52+ "dependency_snapshots": {"limit":10,"remaining":9,"reset":1372700881},
53+ "code_search": {"limit":11,"remaining":10,"reset":1372700882}
5054 }}` )
5155 })
5256
@@ -97,6 +101,16 @@ func TestRateLimits(t *testing.T) {
97101 Remaining : 8 ,
98102 Reset : Timestamp {time .Date (2013 , time .July , 1 , 17 , 48 , 00 , 0 , time .UTC ).Local ()},
99103 },
104+ DependencySnapshots : & Rate {
105+ Limit : 10 ,
106+ Remaining : 9 ,
107+ Reset : Timestamp {time .Date (2013 , time .July , 1 , 17 , 48 , 1 , 0 , time .UTC ).Local ()},
108+ },
109+ CodeSearch : & Rate {
110+ Limit : 11 ,
111+ Remaining : 10 ,
112+ Reset : Timestamp {time .Date (2013 , time .July , 1 , 17 , 48 , 2 , 0 , time .UTC ).Local ()},
113+ },
100114 }
101115 if ! cmp .Equal (rate , want ) {
102116 t .Errorf ("RateLimits returned %+v, want %+v" , rate , want )
@@ -137,6 +151,14 @@ func TestRateLimits(t *testing.T) {
137151 category : scimCategory ,
138152 rate : want .SCIM ,
139153 },
154+ {
155+ category : dependencySnapshotsCategory ,
156+ rate : want .DependencySnapshots ,
157+ },
158+ {
159+ category : codeSearchCategory ,
160+ rate : want .CodeSearch ,
161+ },
140162 }
141163
142164 for _ , tt := range tests {
@@ -177,7 +199,9 @@ func TestRateLimits_overQuota(t *testing.T) {
177199 "source_import": {"limit":6,"remaining":5,"reset":1372700877},
178200 "code_scanning_upload": {"limit":7,"remaining":6,"reset":1372700878},
179201 "actions_runner_registration": {"limit":8,"remaining":7,"reset":1372700879},
180- "scim": {"limit":9,"remaining":8,"reset":1372700880}
202+ "scim": {"limit":9,"remaining":8,"reset":1372700880},
203+ "dependency_snapshots": {"limit":10,"remaining":9,"reset":1372700881},
204+ "code_search": {"limit":11,"remaining":10,"reset":1372700882}
181205 }}` )
182206 })
183207
@@ -228,6 +252,16 @@ func TestRateLimits_overQuota(t *testing.T) {
228252 Remaining : 8 ,
229253 Reset : Timestamp {time .Date (2013 , time .July , 1 , 17 , 48 , 00 , 0 , time .UTC ).Local ()},
230254 },
255+ DependencySnapshots : & Rate {
256+ Limit : 10 ,
257+ Remaining : 9 ,
258+ Reset : Timestamp {time .Date (2013 , time .July , 1 , 17 , 48 , 1 , 0 , time .UTC ).Local ()},
259+ },
260+ CodeSearch : & Rate {
261+ Limit : 11 ,
262+ Remaining : 10 ,
263+ Reset : Timestamp {time .Date (2013 , time .July , 1 , 17 , 48 , 2 , 0 , time .UTC ).Local ()},
264+ },
231265 }
232266 if ! cmp .Equal (rate , want ) {
233267 t .Errorf ("RateLimits returned %+v, want %+v" , rate , want )
@@ -269,6 +303,14 @@ func TestRateLimits_overQuota(t *testing.T) {
269303 category : scimCategory ,
270304 rate : want .SCIM ,
271305 },
306+ {
307+ category : dependencySnapshotsCategory ,
308+ rate : want .DependencySnapshots ,
309+ },
310+ {
311+ category : codeSearchCategory ,
312+ rate : want .CodeSearch ,
313+ },
272314 }
273315 for _ , tt := range tests {
274316 if got , want := client .rateLimits [tt .category ], * tt .rate ; got != want {
@@ -321,6 +363,16 @@ func TestRateLimits_Marshal(t *testing.T) {
321363 Remaining : 1 ,
322364 Reset : Timestamp {referenceTime },
323365 },
366+ DependencySnapshots : & Rate {
367+ Limit : 1 ,
368+ Remaining : 1 ,
369+ Reset : Timestamp {referenceTime },
370+ },
371+ CodeSearch : & Rate {
372+ Limit : 1 ,
373+ Remaining : 1 ,
374+ Reset : Timestamp {referenceTime },
375+ },
324376 }
325377
326378 want := `{
@@ -363,6 +415,16 @@ func TestRateLimits_Marshal(t *testing.T) {
363415 "limit": 1,
364416 "remaining": 1,
365417 "reset": ` + referenceTimeStr + `
418+ },
419+ "dependency_snapshots": {
420+ "limit": 1,
421+ "remaining": 1,
422+ "reset": ` + referenceTimeStr + `
423+ },
424+ "code_search": {
425+ "limit": 1,
426+ "remaining": 1,
427+ "reset": ` + referenceTimeStr + `
366428 }
367429 }`
368430
0 commit comments