MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / TestCheckAgentCreate_AllowsBelowCap

Function TestCheckAgentCreate_AllowsBelowCap

internal/limits/limits_test.go:150–158  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

148}
149
150func TestCheckAgentCreate_AllowsBelowCap(t *testing.T) {
151 store := &fakeStore{found: true, row: Limits{MaxAgents: 3, MaxDomains: 1, MaxMessagesMonth: 1, MaxStorageBytes: 1}}
152 counter := &fakeCounter{agents: 2}
153 e := newEnforcerWithReader(store, counter, defaultsForTest(), 0)
154
155 if err := e.CheckAgentCreate(context.Background(), "user1"); err != nil {
156 t.Errorf("CheckAgentCreate at 2/3: %v, want nil", err)
157 }
158}
159
160func TestCheckAgentCreate_BlocksAtCap(t *testing.T) {
161 store := &fakeStore{found: true, row: Limits{PlanCode: "free", MaxAgents: 3, MaxDomains: 1, MaxMessagesMonth: 1, MaxStorageBytes: 1, UpgradeURL: "https://up"}}

Callers

nothing calls this directly

Calls 3

newEnforcerWithReaderFunction · 0.85
defaultsForTestFunction · 0.85
CheckAgentCreateMethod · 0.65

Tested by

no test coverage detected