aboutsummaryrefslogtreecommitdiffstats
path: root/client/go/cmd/command_tester.go
diff options
context:
space:
mode:
Diffstat (limited to 'client/go/cmd/command_tester.go')
-rw-r--r--client/go/cmd/command_tester.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/client/go/cmd/command_tester.go b/client/go/cmd/command_tester.go
index 095a1af7ac3..3d19e772875 100644
--- a/client/go/cmd/command_tester.go
+++ b/client/go/cmd/command_tester.go
@@ -8,7 +8,6 @@ import (
"bytes"
"crypto/tls"
"io/ioutil"
- "log"
"net/http"
"os"
"path/filepath"
@@ -16,7 +15,6 @@ import (
"testing"
"time"
- "github.com/logrusorgru/aurora"
"github.com/spf13/pflag"
"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
@@ -34,9 +32,6 @@ func execute(cmd command, t *testing.T, client *mockHttpClient) string {
util.ActiveHttpClient = client
}
- // Never print colors in tests
- color = aurora.NewAurora(false)
-
// Set config dir. Use a separate one per test if none is specified
if cmd.homeDir == "" {
cmd.homeDir = t.TempDir()
@@ -62,7 +57,9 @@ func execute(cmd command, t *testing.T, client *mockHttpClient) string {
// Capture stdout and execute command
var b bytes.Buffer
- log.SetOutput(&b)
+ stdout = &b
+
+ // Execute command and return output
rootCmd.SetArgs(append(cmd.args, cmd.moreArgs...))
rootCmd.Execute()
out, err := ioutil.ReadAll(&b)