fabric/cli/cli_test.go

27 lines
508 B
Go
Raw Normal View History

2024-08-22 21:45:36 +02:00
package cli
import (
2024-09-27 12:07:11 +02:00
"github.com/danielmiessler/fabric/core"
2024-08-22 21:45:36 +02:00
"os"
"testing"
"github.com/danielmiessler/fabric/db"
"github.com/stretchr/testify/assert"
)
func TestCli(t *testing.T) {
2024-09-27 12:07:11 +02:00
os.Args = os.Args[:1]
2024-09-26 21:09:01 +02:00
message, err := Cli("test")
2024-09-27 12:07:11 +02:00
assert.Error(t, err)
assert.Equal(t, core.NoSessionPatternUserMessages, err.Error())
2024-08-22 21:45:36 +02:00
assert.Empty(t, message)
}
func TestSetup(t *testing.T) {
mockDB := db.NewDb(os.TempDir())
fabric, err := Setup(mockDB, false)
assert.Error(t, err)
assert.Nil(t, fabric)
}