MCPcopy Create free account
hub / github.com/easyp-tech/server / mockProvider

Struct mockProvider

internal/connect/api_test.go:32–43  ·  view source on GitHub ↗

mockProvider implements provider for testing.

Source from the content-addressed store, hash-verified

30
31// mockProvider implements provider for testing.
32type mockProvider struct {
33 meta content.Meta
34 files []content.File
35 err error
36 repos []source.Source
37 // Optional per-commit overrides. When non-nil, GetMeta/GetFiles serve the
38 // entry for the requested commit (or a not-found error), letting tests
39 // distinguish HEAD from an older sha. When nil, the legacy m.meta/m.files
40 // behavior is used (ignoring the commit arg).
41 byCommit map[string]content.Meta
42 filesByCommit map[string][]content.File
43}
44
45func (m *mockProvider) GetMeta(_ context.Context, _, _, commit string) (content.Meta, error) {
46 if m.byCommit != nil {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected