@@ -244,8 +244,8 @@ func TestInitConfig(t *testing.T) {
244
244
strings .NewReader ("1\n " ),
245
245
strings .NewReader ("1\n " ),
246
246
strings .NewReader ("1\n " ),
247
- strings .NewReader ("1\n " ),
248
247
strings .NewReader ("anapikey\n " ),
248
+ strings .NewReader ("1\n " ),
249
249
),
250
250
Writer : new (bytes.Buffer ),
251
251
ErrWriter : new (bytes.Buffer ),
@@ -265,8 +265,8 @@ func TestInitConfig(t *testing.T) {
265
265
},
266
266
wantOutput : disclaimer + missingConfigMsg + hostChoiceMsg + "\n " +
267
267
fmt .Sprintf (essChoiceMsg , essHostAddress ) + regionChoiceMsg + "\n " +
268
- formatChoiceMsg + "\n " + authChoiceMsg + "\n " + apiKeyMsg + "\n " +
269
- " \n " + fmt .Sprintf (validCredentialsMsg , "anacleto" ) + finalMsg + "\n " ,
268
+ apiKeyMsg + "\n " + formatChoiceMsg + "\n " + "\n " +
269
+ fmt .Sprintf (validCredentialsMsg , "anacleto" ) + finalMsg + "\n " ,
270
270
},
271
271
{
272
272
name : "doesn't find a config file and user creates a new one with user/pass" ,
@@ -277,9 +277,9 @@ func TestInitConfig(t *testing.T) {
277
277
strings .NewReader ("y\n " ),
278
278
strings .NewReader ("2\n " ),
279
279
strings .NewReader ("https://ahost\n " ),
280
- strings .NewReader ("1\n " ),
281
280
strings .NewReader ("2\n " ),
282
281
strings .NewReader ("auser\n " ),
282
+ strings .NewReader ("1\n " ),
283
283
),
284
284
Writer : new (bytes.Buffer ),
285
285
ErrWriter : new (bytes.Buffer ),
@@ -303,7 +303,7 @@ func TestInitConfig(t *testing.T) {
303
303
"user" : "auser" ,
304
304
},
305
305
wantOutput : disclaimer + missingConfigMsg + hostChoiceMsg + "\n " + eceHostMsg +
306
- formatChoiceMsg + "\n " + authChoiceMsg + "\n " + userMsg + passMsg +
306
+ authChoiceMsg + "\n " + userMsg + passMsg + "\n " + formatChoiceMsg +
307
307
"\n " + "\n " + fmt .Sprintf (validCredentialsMsg , "auser" ) + finalMsg + "\n " ,
308
308
},
309
309
{
@@ -316,8 +316,8 @@ func TestInitConfig(t *testing.T) {
316
316
strings .NewReader ("3\n " ),
317
317
strings .NewReader ("https://ahost\n " ),
318
318
strings .NewReader ("1\n " ),
319
- strings .NewReader ("1\n " ),
320
319
strings .NewReader ("anapikey\n " ),
320
+ strings .NewReader ("1\n " ),
321
321
),
322
322
Writer : new (bytes.Buffer ),
323
323
ErrWriter : new (bytes.Buffer ),
@@ -338,7 +338,7 @@ func TestInitConfig(t *testing.T) {
338
338
wantOutput : disclaimer +
339
339
fmt .Sprintf (settingsPathMsg , "test_files/userpassmodif.yaml" ) +
340
340
userPassConfigToModifyContents + "\n " + existingConfigMsg + hostChoiceMsg +
341
- "\n " + esspHostMsg + formatChoiceMsg + "\n " + authChoiceMsg + " \n " + apiKeyMsg +
341
+ "\n " + esspHostMsg + apiKeyMsg + "\n " + formatChoiceMsg +
342
342
"\n " + "\n " + fmt .Sprintf (validCredentialsMsg , "anacleto" ) + finalMsg + "\n " ,
343
343
},
344
344
{
@@ -350,9 +350,9 @@ func TestInitConfig(t *testing.T) {
350
350
strings .NewReader ("y\n " ),
351
351
strings .NewReader ("2\n " ),
352
352
strings .NewReader ("https://ahost\n " ),
353
- strings .NewReader ("1\n " ),
354
353
strings .NewReader ("2\n " ),
355
354
strings .NewReader ("auser\n " ),
355
+ strings .NewReader ("1\n " ),
356
356
),
357
357
Writer : new (bytes.Buffer ),
358
358
ErrWriter : new (bytes.Buffer ),
@@ -378,8 +378,8 @@ func TestInitConfig(t *testing.T) {
378
378
wantOutput : disclaimer +
379
379
fmt .Sprintf (settingsPathMsg , "test_files/apikeymodif.yaml" ) +
380
380
apiKeyConfigToModifyContents + "\n " + existingConfigMsg + hostChoiceMsg +
381
- "\n " + eceHostMsg + formatChoiceMsg + " \n " + authChoiceMsg + "\n " + userMsg +
382
- passMsg + "\n " + "\n " + fmt .Sprintf (validCredentialsMsg , "auser" ) + finalMsg + "\n " ,
381
+ "\n " + eceHostMsg + authChoiceMsg + "\n " + userMsg +
382
+ passMsg + "\n " + formatChoiceMsg + " \n " + "\n " + fmt .Sprintf (validCredentialsMsg , "auser" ) + finalMsg + "\n " ,
383
383
},
384
384
}
385
385
for _ , tt := range tests {
0 commit comments