Skip to content

Commit

Permalink
tests, rename + move (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkieltyka authored Nov 7, 2024
1 parent 79529fe commit c1cab24
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
14 changes: 7 additions & 7 deletions handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/mem.go → tests/mock/mem.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package test
package mock

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion test/server.go → tests/mock/server.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package test
package mock

import (
"context"
Expand Down
5 changes: 5 additions & 0 deletions tests/quotacontrol_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package tests

func init() {
// TODO .........
}

0 comments on commit c1cab24

Please sign in to comment.