Removed unneeded dependency.
This commit is contained in:
parent
aace72f063
commit
1ccb0cad1a
3 changed files with 8 additions and 11 deletions
2
go.mod
2
go.mod
|
|
@ -18,7 +18,6 @@ require (
|
||||||
github.com/labstack/gommon v0.3.1
|
github.com/labstack/gommon v0.3.1
|
||||||
github.com/stretchr/testify v1.7.0
|
github.com/stretchr/testify v1.7.0
|
||||||
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871
|
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871
|
||||||
k8s.io/apimachinery v0.0.0-20191123233150-4c4803ed55e3
|
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
|
@ -75,4 +74,5 @@ require (
|
||||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
|
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
|
||||||
gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 // indirect
|
gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
||||||
|
k8s.io/apimachinery v0.0.0-20191123233150-4c4803ed55e3 // indirect
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,6 @@ import (
|
||||||
"github.com/go-playground/assert/v2"
|
"github.com/go-playground/assert/v2"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/util/rand"
|
|
||||||
|
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -26,23 +24,23 @@ func TestMsg(t *testing.T) {
|
||||||
require.Len(t, ret, 0)
|
require.Len(t, ret, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
text := rand.String(10)
|
text := "aaa"
|
||||||
Success(ctx, text)
|
Success(ctx, text)
|
||||||
assertMsg(TypeSuccess, text)
|
assertMsg(TypeSuccess, text)
|
||||||
|
|
||||||
text = rand.String(10)
|
text = "bbb"
|
||||||
Info(ctx, text)
|
Info(ctx, text)
|
||||||
assertMsg(TypeInfo, text)
|
assertMsg(TypeInfo, text)
|
||||||
|
|
||||||
text = rand.String(10)
|
text = "ccc"
|
||||||
Danger(ctx, text)
|
Danger(ctx, text)
|
||||||
assertMsg(TypeDanger, text)
|
assertMsg(TypeDanger, text)
|
||||||
|
|
||||||
text = rand.String(10)
|
text = "ddd"
|
||||||
Warning(ctx, text)
|
Warning(ctx, text)
|
||||||
assertMsg(TypeWarning, text)
|
assertMsg(TypeWarning, text)
|
||||||
|
|
||||||
text = rand.String(10)
|
text = "eee"
|
||||||
Set(ctx, TypeSuccess, text)
|
Set(ctx, TypeSuccess, text)
|
||||||
assertMsg(TypeSuccess, text)
|
assertMsg(TypeSuccess, text)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package tests
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"math/rand"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
@ -14,8 +15,6 @@ import (
|
||||||
"github.com/go-playground/assert/v2"
|
"github.com/go-playground/assert/v2"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/util/rand"
|
|
||||||
|
|
||||||
"github.com/gorilla/sessions"
|
"github.com/gorilla/sessions"
|
||||||
"github.com/labstack/echo-contrib/session"
|
"github.com/labstack/echo-contrib/session"
|
||||||
"github.com/labstack/echo/v4"
|
"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) {
|
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.
|
return orm.User.
|
||||||
Create().
|
Create().
|
||||||
SetEmail(fmt.Sprintf("testuser-%s@localhost.localhost", seed)).
|
SetEmail(fmt.Sprintf("testuser-%s@localhost.localhost", seed)).
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue