MCPcopy Create free account
hub / github.com/gogs/gogs / SetMockRepository

Function SetMockRepository

internal/conf/mocks.go:50–58  ·  view source on GitHub ↗
(t *testing.T, opts RepositoryOpts)

Source from the content-addressed store, hash-verified

48var mockRepository sync.Mutex
49
50func SetMockRepository(t *testing.T, opts RepositoryOpts) {
51 mockRepository.Lock()
52 before := Repository
53 Repository = opts
54 t.Cleanup(func() {
55 Repository = before
56 mockRepository.Unlock()
57 })
58}
59
60func SetMockUI(t *testing.T, opts UIOpts) {
61 before := UI

Callers 5

usersChangeUsernameFunction · 0.92
usersDeleteByIDFunction · 0.92
TestUserPathFunction · 0.92
TestRepositoryPathFunction · 0.92

Calls

no outgoing calls

Tested by 5

usersChangeUsernameFunction · 0.74
usersDeleteByIDFunction · 0.74
TestUserPathFunction · 0.74
TestRepositoryPathFunction · 0.74