Created
February 8, 2019 16:39
-
-
Save dimroc/a7eafff01081a21d491b3dd43d0e1da7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/cmd/client_test.go b/cmd/client_test.go | |
index 3def9489..75062b78 100644 | |
--- a/cmd/client_test.go | |
+++ b/cmd/client_test.go | |
@@ -178,7 +178,7 @@ func TestFileAPIInitializer_InitializeWithoutAPIUser(t *testing.T) { | |
file string | |
wantError bool | |
}{ | |
- {"correct", "../internal/fixtures/apicredentials", false}, | |
+ {"correct", "testdata/apicredentials", false}, | |
{"no file", "", true}, | |
{"incorrect file", "/tmp/doesnotexist", true}, | |
} | |
@@ -216,7 +216,7 @@ func TestFileAPIInitializer_InitializeWithExistingAPIUser(t *testing.T) { | |
file string | |
wantError bool | |
}{ | |
- {"correct", "../internal/fixtures/apicredentials", false}, | |
+ {"correct", "testdata/apicredentials", false}, | |
{"no file", "", true}, | |
{"incorrect file", "/tmp/doesnotexist", true}, | |
} | |
@@ -262,7 +262,7 @@ func TestFileSessionRequestBuilder(t *testing.T) { | |
wantError bool | |
}{ | |
{"empty", "", "", true}, | |
- {"correct file", "../internal/fixtures/apicredentials", "email@test.net", false}, | |
+ {"correct file", "testdata/apicredentials", "email@test.net", false}, | |
{"incorrect file", "/tmp/dontexist", "", true}, | |
} | |
diff --git a/cmd/local_client_test.go b/cmd/local_client_test.go | |
index 9add1386..3c4749a1 100644 | |
--- a/cmd/local_client_test.go | |
+++ b/cmd/local_client_test.go | |
@@ -132,7 +132,7 @@ func TestClient_RunNodeWithAPICredentialsFile(t *testing.T) { | |
wantPrompt bool | |
wantError bool | |
}{ | |
- {"correct", "../internal/fixtures/apicredentials", false, false}, | |
+ {"correct", "testdata/apicredentials", false, false}, | |
{"no file", "", true, false}, | |
{"wrong file", "doesntexist.txt", false, true}, | |
} | |
diff --git a/cmd/remote_client_test.go b/cmd/remote_client_test.go | |
index 1848c186..fcce6346 100644 | |
--- a/cmd/remote_client_test.go | |
+++ b/cmd/remote_client_test.go | |
@@ -381,7 +381,7 @@ func TestClient_RemoteLogin(t *testing.T) { | |
wantError bool | |
}{ | |
{"success prompt", "", cltest.APIEmail, cltest.Password, false}, | |
- {"success file", "../internal/fixtures/apicredentials", "", "", false}, | |
+ {"success file", "testdata/apicredentials", "", "", false}, | |
{"failure prompt", "", "wrong@email.com", "wrongpwd", true}, | |
{"failure file", "/tmp/doesntexist", "", "", true}, | |
{"failure file w correct prompt", "/tmp/doesntexist", cltest.APIEmail, cltest.Password, true}, | |
@@ -536,7 +536,7 @@ func TestClient_ChangePassword(t *testing.T) { | |
otherClient := app.NewAuthenticatingClient(prompter) | |
set := flag.NewFlagSet("test", 0) | |
- set.String("file", "../internal/fixtures/apicredentials", "") | |
+ set.String("file", filepath.Join("testdata", "apicredentials"), "") | |
c := cli.NewContext(nil, set, nil) | |
err := client.RemoteLogin(c) | |
assert.NoError(t, err) | |
@@ -605,7 +605,7 @@ func TestClient_CreateExtraKey(t *testing.T) { | |
client, _ := app.NewClientAndRenderer() | |
set := flag.NewFlagSet("test", 0) | |
- set.String("file", "../internal/fixtures/apicredentials", "") | |
+ set.String("file", "testdata/apicredentials", "") | |
c := cli.NewContext(nil, set, nil) | |
err := client.RemoteLogin(c) | |
assert.NoError(t, err) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment