Removed unneeded dependency.

This commit is contained in:
mikestefanello 2021-12-25 21:04:19 -05:00
parent aace72f063
commit 1ccb0cad1a
3 changed files with 8 additions and 11 deletions

2
go.mod
View File

@ -18,7 +18,6 @@ require (
github.com/labstack/gommon v0.3.1
github.com/stretchr/testify v1.7.0
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871
k8s.io/apimachinery v0.0.0-20191123233150-4c4803ed55e3
)
require (
@ -75,4 +74,5 @@ require (
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/apimachinery v0.0.0-20191123233150-4c4803ed55e3 // indirect
)

View File

@ -8,8 +8,6 @@ import (
"github.com/go-playground/assert/v2"
"github.com/stretchr/testify/require"
"k8s.io/apimachinery/pkg/util/rand"
"github.com/labstack/echo/v4"
)
@ -26,23 +24,23 @@ func TestMsg(t *testing.T) {
require.Len(t, ret, 0)
}
text := rand.String(10)
text := "aaa"
Success(ctx, text)
assertMsg(TypeSuccess, text)
text = rand.String(10)
text = "bbb"
Info(ctx, text)
assertMsg(TypeInfo, text)
text = rand.String(10)
text = "ccc"
Danger(ctx, text)
assertMsg(TypeDanger, text)
text = rand.String(10)
text = "ddd"
Warning(ctx, text)
assertMsg(TypeWarning, text)
text = rand.String(10)
text = "eee"
Set(ctx, TypeSuccess, text)
assertMsg(TypeSuccess, text)
}

View File

@ -3,6 +3,7 @@ package tests
import (
"context"
"fmt"
"math/rand"
"net/http"
"net/http/httptest"
"strings"
@ -14,8 +15,6 @@ import (
"github.com/go-playground/assert/v2"
"github.com/stretchr/testify/require"
"k8s.io/apimachinery/pkg/util/rand"
"github.com/gorilla/sessions"
"github.com/labstack/echo-contrib/session"
"github.com/labstack/echo/v4"
@ -46,7 +45,7 @@ func AssertHTTPErrorCode(t *testing.T, err error, code int) {
}
func CreateUser(orm *ent.Client) (*ent.User, error) {
seed := fmt.Sprintf("%d-%d", time.Now().UnixMilli(), rand.IntnRange(10, 1000000))
seed := fmt.Sprintf("%d-%d", time.Now().UnixMilli(), rand.Intn(1000000))
return orm.User.
Create().
SetEmail(fmt.Sprintf("testuser-%s@localhost.localhost", seed)).