Files
openlan/pkg/cache/store_test.go
Daniel Ding 2d2d842e65
Some checks failed
Coverage CI / build (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
Ubuntu CI / build (push) Has been cancelled
fix: limit users.
2025-12-22 19:38:23 +08:00

32 lines
566 B
Go

package cache
import (
"fmt"
"testing"
"github.com/luscis/openlan/pkg/config"
"github.com/luscis/openlan/pkg/libol"
"github.com/luscis/openlan/pkg/models"
"github.com/stretchr/testify/assert"
)
type SocketClientMock struct {
libol.SocketClientImpl
}
func (s *SocketClientMock) String() string {
return "fake"
}
func TestInit(t *testing.T) {
cfg := &config.Limit{}
cfg.Correct()
Init(cfg)
fmt.Println(Access)
Access.Add(&models.Access{
UUID: "fake",
Client: &SocketClientMock{},
})
assert.Equal(t, 1, Access.Clients.Len(), "MUST be same")
}