Update quota service to accept context (#45186)

This commit is contained in:
Yuriy Tseretyan
2022-02-10 16:17:50 -05:00
committed by GitHub
parent c59567a236
commit d4ac1f0ce1
2 changed files with 44 additions and 14 deletions

View File

@@ -4,10 +4,12 @@ import (
"context"
"testing"
"github.com/stretchr/testify/assert"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/quota"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/web"
"github.com/stretchr/testify/assert"
)
func TestMiddlewareQuota(t *testing.T) {
@@ -246,3 +248,7 @@ type mockQuotaService struct {
func (m *mockQuotaService) QuotaReached(c *models.ReqContext, target string) (bool, error) {
return m.reached, m.err
}
func (m *mockQuotaService) CheckQuotaReached(c context.Context, target string, params *quota.ScopeParameters) (bool, error) {
return m.reached, m.err
}