Files
coder/cli/publickey_test.go
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
596 B
Go
Raw Normal View History

2022-04-07 17:40:27 -05:00
package cli_test
import (
"bytes"
"testing"
"github.com/stretchr/testify/require"
"github.com/coder/coder/v2/cli/clitest"
"github.com/coder/coder/v2/coderd/coderdtest"
2022-04-07 17:40:27 -05:00
)
func TestPublicKey(t *testing.T) {
t.Parallel()
t.Run("OK", func(t *testing.T) {
2022-08-21 17:32:53 -05:00
t.Parallel()
2022-04-07 17:40:27 -05:00
client := coderdtest.New(t, nil)
_ = coderdtest.CreateFirstUser(t, client)
2023-03-23 17:42:20 -05:00
inv, root := clitest.New(t, "publickey")
2022-04-07 17:40:27 -05:00
clitest.SetupConfig(t, client, root)
buf := new(bytes.Buffer)
2023-03-23 17:42:20 -05:00
inv.Stdout = buf
err := inv.Run()
2022-04-07 17:40:27 -05:00
require.NoError(t, err)
publicKey := buf.String()
require.NotEmpty(t, publicKey)
})
}