mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-12 06:24:10 +01:00
cmd: test command checks
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"testing"
|
||||
|
||||
"akvorado/common/reporter"
|
||||
@@ -17,3 +18,14 @@ func TestConsoleStart(t *testing.T) {
|
||||
t.Fatalf("consoleStart() error:\n%+v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestConsole(t *testing.T) {
|
||||
root := RootCmd
|
||||
buf := new(bytes.Buffer)
|
||||
root.SetOut(buf)
|
||||
root.SetArgs([]string{"console", "--check", "/dev/null"})
|
||||
err := root.Execute()
|
||||
if err != nil {
|
||||
t.Errorf("`console` error:\n%+v", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user