@@ -28,8 +28,9 @@ func TestRateLimits_String(t *testing.T) {
2828 DependencySnapshots : & Rate {},
2929 CodeSearch : & Rate {},
3030 AuditLog : & Rate {},
31+ DependencySBOM : & Rate {},
3132 }
32- want := `github.RateLimits{Core:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, Search:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, GraphQL:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, IntegrationManifest:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, SourceImport:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, CodeScanningUpload:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, ActionsRunnerRegistration:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, SCIM:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, DependencySnapshots:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, CodeSearch:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, AuditLog:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}}`
33+ want := `github.RateLimits{Core:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, Search:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, GraphQL:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, IntegrationManifest:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, SourceImport:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, CodeScanningUpload:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, ActionsRunnerRegistration:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, SCIM:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, DependencySnapshots:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, CodeSearch:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, AuditLog:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, DependencySBOM:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}}`
3334 if got := v .String (); got != want {
3435 t .Errorf ("RateLimits.String = %v, want %v" , got , want )
3536 }
@@ -52,7 +53,8 @@ func TestRateLimits(t *testing.T) {
5253 "scim": {"limit":9,"remaining":8,"used":1,"reset":1372700880},
5354 "dependency_snapshots": {"limit":10,"remaining":9,"used":1,"reset":1372700881},
5455 "code_search": {"limit":11,"remaining":10,"used":1,"reset":1372700882},
55- "audit_log": {"limit": 12,"remaining":11,"used":1,"reset":1372700883}
56+ "audit_log": {"limit": 12,"remaining":11,"used":1,"reset":1372700883},
57+ "dependency_sbom": {"limit": 100,"remaining":100,"used":0,"reset":1372700884}
5658 }}` )
5759 })
5860
@@ -129,6 +131,12 @@ func TestRateLimits(t *testing.T) {
129131 Used : 1 ,
130132 Reset : Timestamp {time .Date (2013 , time .July , 1 , 17 , 48 , 3 , 0 , time .UTC ).Local ()},
131133 },
134+ DependencySBOM : & Rate {
135+ Limit : 100 ,
136+ Remaining : 100 ,
137+ Used : 0 ,
138+ Reset : Timestamp {time .Date (2013 , time .July , 1 , 17 , 48 , 4 , 0 , time .UTC ).Local ()},
139+ },
132140 }
133141 if ! cmp .Equal (rate , want ) {
134142 t .Errorf ("RateLimits returned %+v, want %+v" , rate , want )
@@ -181,6 +189,10 @@ func TestRateLimits(t *testing.T) {
181189 category : AuditLogCategory ,
182190 rate : want .AuditLog ,
183191 },
192+ {
193+ category : DependencySBOMCategory ,
194+ rate : want .DependencySBOM ,
195+ },
184196 }
185197
186198 for _ , tt := range tests {
@@ -225,7 +237,8 @@ func TestRateLimits_overQuota(t *testing.T) {
225237 "scim": {"limit":9,"remaining":8,"used":1,"reset":1372700880},
226238 "dependency_snapshots": {"limit":10,"remaining":9,"used":1,"reset":1372700881},
227239 "code_search": {"limit":11,"remaining":10,"used":1,"reset":1372700882},
228- "audit_log": {"limit":12,"remaining":11,"used":1,"reset":1372700883}
240+ "audit_log": {"limit":12,"remaining":11,"used":1,"reset":1372700883},
241+ "dependency_sbom": {"limit":13,"remaining":12,"used":1,"reset":1372700884}
229242 }}` )
230243 })
231244
@@ -302,6 +315,12 @@ func TestRateLimits_overQuota(t *testing.T) {
302315 Used : 1 ,
303316 Reset : Timestamp {time .Date (2013 , time .July , 1 , 17 , 48 , 3 , 0 , time .UTC ).Local ()},
304317 },
318+ DependencySBOM : & Rate {
319+ Limit : 13 ,
320+ Remaining : 12 ,
321+ Used : 1 ,
322+ Reset : Timestamp {time .Date (2013 , time .July , 1 , 17 , 48 , 4 , 0 , time .UTC ).Local ()},
323+ },
305324 }
306325 if ! cmp .Equal (rate , want ) {
307326 t .Errorf ("RateLimits returned %+v, want %+v" , rate , want )
@@ -355,6 +374,10 @@ func TestRateLimits_overQuota(t *testing.T) {
355374 category : AuditLogCategory ,
356375 rate : want .AuditLog ,
357376 },
377+ {
378+ category : DependencySBOMCategory ,
379+ rate : want .DependencySBOM ,
380+ },
358381 }
359382 for _ , tt := range tests {
360383 if got , want := client .rateLimits [tt .category ], * tt .rate ; got != want {
@@ -434,6 +457,12 @@ func TestRateLimits_Marshal(t *testing.T) {
434457 Used : 0 ,
435458 Reset : Timestamp {referenceTime },
436459 },
460+ DependencySBOM : & Rate {
461+ Limit : 1 ,
462+ Remaining : 1 ,
463+ Used : 0 ,
464+ Reset : Timestamp {referenceTime },
465+ },
437466 }
438467
439468 want := `{
@@ -502,6 +531,12 @@ func TestRateLimits_Marshal(t *testing.T) {
502531 "remaining": 1,
503532 "used": 0,
504533 "reset": ` + referenceTimeStr + `
534+ },
535+ "dependency_sbom": {
536+ "limit": 1,
537+ "remaining": 1,
538+ "used": 0,
539+ "reset": ` + referenceTimeStr + `
505540 }
506541 }`
507542
0 commit comments