fixes to unit test to reflect removal of approveAll and non-required csrName args

This commit is contained in:
Damian Miller 2022-08-22 13:23:51 -04:00 коммит произвёл Zach Jones
Родитель c572368328
Коммит 397b6fbcd7
1 изменённых файлов: 12 добавлений и 12 удалений

Просмотреть файл

@ -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()