зеркало из https://github.com/Azure/ARO-RP.git
fixes to unit test to reflect removal of approveAll and non-required csrName args
This commit is contained in:
Родитель
c572368328
Коммит
397b6fbcd7
|
@ -54,7 +54,7 @@ func TestAdminApproveCSR(t *testing.T) {
|
|||
method: http.MethodPost,
|
||||
name: "all csrs",
|
||||
resourceID: fmt.Sprintf("/subscriptions/%s/resourcegroups/resourceGroup/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName", mockSubID),
|
||||
csrName: "aro-csr",
|
||||
//csrName: "aro-csr",
|
||||
//approveAll: "true",
|
||||
mocks: func(tt *test, k *mock_adminactions.MockKubeActions) {
|
||||
k.EXPECT().
|
||||
|
@ -63,17 +63,17 @@ func TestAdminApproveCSR(t *testing.T) {
|
|||
},
|
||||
wantStatusCode: http.StatusOK,
|
||||
},
|
||||
{
|
||||
method: http.MethodPost,
|
||||
name: "invalid csr name",
|
||||
resourceID: fmt.Sprintf("/subscriptions/%s/resourcegroups/resourceGroup/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName", mockSubID),
|
||||
csrName: "",
|
||||
// approveAll: "false",
|
||||
mocks: func(tt *test, k *mock_adminactions.MockKubeActions) {
|
||||
},
|
||||
wantStatusCode: http.StatusBadRequest,
|
||||
wantError: "400: InvalidParameter: : The provided name '' is invalid.",
|
||||
},
|
||||
// {
|
||||
// method: http.MethodPost,
|
||||
// name: "invalid csr name",
|
||||
// resourceID: fmt.Sprintf("/subscriptions/%s/resourcegroups/resourceGroup/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName", mockSubID),
|
||||
// csrName: "",
|
||||
// // approveAll: "false",
|
||||
// mocks: func(tt *test, k *mock_adminactions.MockKubeActions) {
|
||||
// },
|
||||
// wantStatusCode: http.StatusBadRequest,
|
||||
// wantError: "400: InvalidParameter: : The provided name '' is invalid.",
|
||||
// },
|
||||
} {
|
||||
t.Run(fmt.Sprintf("%s: %s", tt.method, tt.name), func(t *testing.T) {
|
||||
ti := newTestInfra(t).WithOpenShiftClusters().WithSubscriptions()
|
||||
|
|
Загрузка…
Ссылка в новой задаче