From c1cab242c48880139fa41d8ffefcd3c705b66932 Mon Sep 17 00:00:00 2001 From: Peter Kieltyka Date: Thu, 7 Nov 2024 14:19:57 -0500 Subject: [PATCH] tests, rename + move (#66) --- handler_test.go | 14 +++++++------- {test => tests/mock}/mem.go | 2 +- {test => tests/mock}/server.go | 2 +- tests/quotacontrol_test.go | 5 +++++ 4 files changed, 14 insertions(+), 9 deletions(-) rename {test => tests/mock}/mem.go (99%) rename {test => tests/mock}/server.go (99%) create mode 100644 tests/quotacontrol_test.go diff --git a/handler_test.go b/handler_test.go index 0280c7b..edfc5c5 100644 --- a/handler_test.go +++ b/handler_test.go @@ -15,7 +15,7 @@ import ( "github.com/0xsequence/quotacontrol" "github.com/0xsequence/quotacontrol/middleware" "github.com/0xsequence/quotacontrol/proto" - "github.com/0xsequence/quotacontrol/test" + "github.com/0xsequence/quotacontrol/tests/mock" "github.com/go-chi/chi/v5" "github.com/goware/logger" "github.com/stretchr/testify/assert" @@ -36,7 +36,7 @@ var ( func TestMiddlewareUseAccessKey(t *testing.T) { cfg := newConfig() - server, cleanup := test.NewServer(&cfg) + server, cleanup := mock.NewServer(&cfg) t.Cleanup(cleanup) now := time.Now() @@ -298,7 +298,7 @@ func TestMiddlewareUseAccessKey(t *testing.T) { func TestDefaultKey(t *testing.T) { cfg := newConfig() - server, cleanup := test.NewServer(&cfg) + server, cleanup := mock.NewServer(&cfg) t.Cleanup(cleanup) now := time.Now() @@ -374,7 +374,7 @@ func TestJWT(t *testing.T) { counter := spendingCounter(0) cfg := newConfig() - server, cleanup := test.NewServer(&cfg) + server, cleanup := mock.NewServer(&cfg) t.Cleanup(cleanup) logger := logger.NewLogger(logger.LogLevel_INFO) @@ -453,7 +453,7 @@ func TestJWTAccess(t *testing.T) { counter := hitCounter(0) cfg := newConfig() - server, cleanup := test.NewServer(&cfg) + server, cleanup := mock.NewServer(&cfg) t.Cleanup(cleanup) logger := logger.NewLogger(logger.LogLevel_INFO) @@ -557,7 +557,7 @@ func TestSession(t *testing.T) { counter := hitCounter(0) cfg := newConfig() - server, cleanup := test.NewServer(&cfg) + server, cleanup := mock.NewServer(&cfg) t.Cleanup(cleanup) logger := logger.NewLogger(logger.LogLevel_INFO) @@ -684,7 +684,7 @@ func TestSessionDisabled(t *testing.T) { cfg := newConfig() cfg.Enabled = false - server, cleanup := test.NewServer(&cfg) + server, cleanup := mock.NewServer(&cfg) t.Cleanup(cleanup) logger := logger.NewLogger(logger.LogLevel_INFO) diff --git a/test/mem.go b/tests/mock/mem.go similarity index 99% rename from test/mem.go rename to tests/mock/mem.go index 31f0b80..9676994 100644 --- a/test/mem.go +++ b/tests/mock/mem.go @@ -1,4 +1,4 @@ -package test +package mock import ( "context" diff --git a/test/server.go b/tests/mock/server.go similarity index 99% rename from test/server.go rename to tests/mock/server.go index 1faab09..eb87055 100644 --- a/test/server.go +++ b/tests/mock/server.go @@ -1,4 +1,4 @@ -package test +package mock import ( "context" diff --git a/tests/quotacontrol_test.go b/tests/quotacontrol_test.go new file mode 100644 index 0000000..a6fa3db --- /dev/null +++ b/tests/quotacontrol_test.go @@ -0,0 +1,5 @@ +package tests + +func init() { + // TODO ......... +}