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

Function TestEnforcer_GetPropagatesStoreError

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

Source from the content-addressed store, hash-verified

111}
112
113func TestEnforcer_GetPropagatesStoreError(t *testing.T) {
114 sentinel := errors.New("db down")
115 store := &fakeStore{err: sentinel}
116 e := newEnforcerWithReader(store, &fakeCounter{}, defaultsForTest(), 0)
117
118 _, err := e.Get(context.Background(), "user1")
119 if !errors.Is(err, sentinel) {
120 t.Errorf("Get error = %v, want %v", err, sentinel)
121 }
122}
123
124func TestEnforcer_CacheServesFromMemoryWithinTTL(t *testing.T) {
125 store := &fakeStore{found: true, row: Limits{PlanCode: "p", MaxAgents: 1, MaxDomains: 1, MaxMessagesMonth: 1, MaxStorageBytes: 1}}

Callers

nothing calls this directly

Calls 3

newEnforcerWithReaderFunction · 0.85
defaultsForTestFunction · 0.85
GetMethod · 0.65

Tested by

no test coverage detected