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

Function TestRemove

entity/dag/entity_actions_test.go:386–408  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

384}
385
386func TestRemove(t *testing.T) {
387 repoA, _, _, id1, _, resolvers, def := makeTestContextRemote(t)
388
389 e := New(def)
390 e.Append(newOp1(id1, "foo"))
391 require.NoError(t, e.Commit(repoA))
392
393 _, err := Push(def, repoA, "remote")
394 require.NoError(t, err)
395
396 err = Remove(def, repoA, e.Id())
397 require.NoError(t, err)
398
399 _, err = Read(def, wrapper, repoA, resolvers, e.Id())
400 require.Error(t, err)
401
402 _, err = readRemote(def, wrapper, repoA, resolvers, "remote", e.Id())
403 require.Error(t, err)
404
405 // Remove is idempotent
406 err = Remove(def, repoA, e.Id())
407 require.NoError(t, err)
408}
409
410func TestRemoveAll(t *testing.T) {
411 repoA, _, _, id1, _, resolvers, def := makeTestContextRemote(t)

Callers

nothing calls this directly

Calls 11

makeTestContextRemoteFunction · 0.85
NewFunction · 0.85
newOp1Function · 0.85
readRemoteFunction · 0.85
PushFunction · 0.70
RemoveFunction · 0.70
ReadFunction · 0.70
AppendMethod · 0.65
CommitMethod · 0.65
IdMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected