(t *testing.T)
| 111 | } |
| 112 | |
| 113 | func 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 | |
| 124 | func TestEnforcer_CacheServesFromMemoryWithinTTL(t *testing.T) { |
| 125 | store := &fakeStore{found: true, row: Limits{PlanCode: "p", MaxAgents: 1, MaxDomains: 1, MaxMessagesMonth: 1, MaxStorageBytes: 1}} |
nothing calls this directly
no test coverage detected