diff options
author | Jon Bratseth <bratseth@oath.com> | 2021-09-27 23:08:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-27 23:08:47 +0200 |
commit | 8f3fb1a105ded07144f6de527266a438e48a1766 (patch) | |
tree | d2923a45682e91d80e7011c60cfb301e05acead3 /client/go/cmd/api_key_test.go | |
parent | 0a858cc0f3425fc792d978b6221ef4f3c3bc6067 (diff) | |
parent | 037f756caf4cfb99bcd988174839d7bc385267b9 (diff) |
Merge branch 'master' into bratseth/linguistics-components
Diffstat (limited to 'client/go/cmd/api_key_test.go')
-rw-r--r-- | client/go/cmd/api_key_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/client/go/cmd/api_key_test.go b/client/go/cmd/api_key_test.go index 2497568604f..1deb628c21e 100644 --- a/client/go/cmd/api_key_test.go +++ b/client/go/cmd/api_key_test.go @@ -4,20 +4,20 @@ package cmd import ( - "strings" + "path/filepath" "testing" "github.com/stretchr/testify/assert" ) func TestAPIKey(t *testing.T) { - homeDir := t.TempDir() - keyFile := homeDir + "/.vespa/t1.api-key.pem" + homeDir := filepath.Join(t.TempDir(), ".vespa") + keyFile := filepath.Join(homeDir, "t1.api-key.pem") out, _ := execute(command{args: []string{"api-key", "-a", "t1.a1.i1"}, homeDir: homeDir}, t, nil) - assert.True(t, strings.HasPrefix(out, "Success: API private key written to "+keyFile+"\n")) + assert.Contains(t, out, "Success: API private key written to "+keyFile+"\n") out, _ = execute(command{args: []string{"api-key", "-a", "t1.a1.i1"}, homeDir: homeDir}, t, nil) - assert.True(t, strings.HasPrefix(out, "Error: File "+keyFile+" already exists\nHint: Use -f to overwrite it\n")) - assert.True(t, strings.Contains(out, "This is your public key")) + assert.Contains(t, out, "Error: File "+keyFile+" already exists\nHint: Use -f to overwrite it\n") + assert.Contains(t, out, "This is your public key") } |