Skip to content

Commit 2d2bf63

Browse files
committed
tests
1 parent a173de1 commit 2d2bf63

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

restapi/resource_quota_test.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,22 @@ import (
1616
type k8sClientMock struct{}
1717

1818
var k8sclientGetResourceQuotaMock func(ctx context.Context, namespace, resource string, opts metav1.GetOptions) (*v1.ResourceQuota, error)
19+
var k8sclientGetSecretMock func(ctx context.Context, namespace, secretName string, opts metav1.GetOptions) (*v1.Secret, error)
20+
var k8sclientGetServiceMock func(ctx context.Context, namespace, serviceName string, opts metav1.GetOptions) (*v1.Service, error)
1921

20-
// mock function of getResourceQuota()
22+
// mock functions
2123
func (c k8sClientMock) getResourceQuota(ctx context.Context, namespace, resource string, opts metav1.GetOptions) (*v1.ResourceQuota, error) {
2224
return k8sclientGetResourceQuotaMock(ctx, namespace, resource, opts)
2325
}
2426

27+
func (c k8sClientMock) getSecret(ctx context.Context, namespace, secretName string, opts metav1.GetOptions) (*v1.Secret, error) {
28+
return k8sclientGetSecretMock(ctx, namespace, secretName, opts)
29+
}
30+
31+
func (c k8sClientMock) getService(ctx context.Context, namespace, serviceName string, opts metav1.GetOptions) (*v1.Service, error) {
32+
return k8sclientGetServiceMock(ctx, namespace, serviceName, opts)
33+
}
34+
2535
func Test_ResourceQuota(t *testing.T) {
2636
mockHardResourceQuota := v1.ResourceList{
2737
"storage": resource.MustParse("1000"),

0 commit comments

Comments
 (0)