MCPcopy
hub / github.com/github/github-mcp-server / newMockRepoAccessCache

Function newMockRepoAccessCache

pkg/lockdown/lockdown_test.go:100–111  ·  view source on GitHub ↗
(t *testing.T, ttl time.Duration)

Source from the content-addressed store, hash-verified

98}
99
100func newMockRepoAccessCache(t *testing.T, ttl time.Duration) (*RepoAccessCache, *countingTransport) {
101 t.Helper()
102 gqlClient, counting := newMockGQLClient(testUser, false)
103 restClient := newMockRESTServer(t, "write")
104 cache := NewRepoAccessCache(
105 gqlClient,
106 restClient,
107 WithTTL(ttl),
108 WithCacheName(t.Name()),
109 )
110 return cache, counting
111}
112
113func TestRepoAccessCacheEvictsAfterTTL(t *testing.T) {
114 ctx := t.Context()

Callers 1

Calls 6

newMockGQLClientFunction · 0.85
newMockRESTServerFunction · 0.85
NewRepoAccessCacheFunction · 0.85
WithTTLFunction · 0.85
WithCacheNameFunction · 0.85
NameMethod · 0.80

Tested by

no test coverage detected