MCPcopy Index your code
hub / github.com/git-bug/git-bug / makeTestContextRemote

Function makeTestContextRemote

entity/dag/common_test.go:118–141  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

116}
117
118func makeTestContextRemote(t *testing.T) (repository.ClockedRepo, repository.ClockedRepo, repository.ClockedRepo, identity.Interface, identity.Interface, entity.Resolvers, Definition) {
119 repoA := repository.CreateGoGitTestRepo(t, false)
120 repoB := repository.CreateGoGitTestRepo(t, false)
121 remote := repository.CreateGoGitTestRepo(t, true)
122
123 err := repoA.AddRemote("remote", remote.GetLocalRemote())
124 require.NoError(t, err)
125 err = repoA.AddRemote("repoB", repoB.GetLocalRemote())
126 require.NoError(t, err)
127 err = repoB.AddRemote("remote", remote.GetLocalRemote())
128 require.NoError(t, err)
129 err = repoB.AddRemote("repoA", repoA.GetLocalRemote())
130 require.NoError(t, err)
131
132 id1, id2, resolver, def := makeTestContextInternal(repoA)
133
134 // distribute the identities
135 _, err = identity.Push(repoA, "remote")
136 require.NoError(t, err)
137 err = identity.Pull(repoB, "remote")
138 require.NoError(t, err)
139
140 return repoA, repoB, remote, id1, id2, resolver, def
141}
142
143func makeTestContextInternal(repo repository.ClockedRepo) (identity.Interface, identity.Interface, entity.Resolvers, Definition) {
144 id1, err := identity.NewIdentity(repo, "name1", "email1")

Callers 5

TestEntityPushPullFunction · 0.85
TestListLocalIdsFunction · 0.85
TestMergeFunction · 0.85
TestRemoveFunction · 0.85
TestRemoveAllFunction · 0.85

Calls 6

CreateGoGitTestRepoFunction · 0.92
PushFunction · 0.92
PullFunction · 0.92
makeTestContextInternalFunction · 0.85
AddRemoteMethod · 0.65
GetLocalRemoteMethod · 0.65

Tested by

no test coverage detected