MCPcopy Index your code
hub / github.com/dnote/dnote / testSyncCmd

Function testSyncCmd

pkg/e2e/sync/testutils.go:246–259  ·  view source on GitHub ↗

testSyncCmd is a test helper that sets up a test environment, runs setup, syncs, and asserts

(t *testing.T, fullSync bool, setup setupFunc, assert assertFunc)

Source from the content-addressed store, hash-verified

244
245// testSyncCmd is a test helper that sets up a test environment, runs setup, syncs, and asserts
246func testSyncCmd(t *testing.T, fullSync bool, setup setupFunc, assert assertFunc) {
247 env := setupTestEnv(t)
248
249 user := setupUserAndLogin(t, env)
250 ids := setup(t, env, user)
251
252 if fullSync {
253 clitest.RunDnoteCmd(t, env.CmdOpts, cliBinaryName, "sync", "-f")
254 } else {
255 clitest.RunDnoteCmd(t, env.CmdOpts, cliBinaryName, "sync")
256 }
257
258 assert(t, env, user, ids)
259}
260
261// systemState represents the expected state of the sync system
262type systemState struct {

Callers 4

TestSync_EmptyFunction · 0.85
TestSync_onewayFunction · 0.85
TestSync_twowayFunction · 0.85
TestSyncFunction · 0.85

Calls 2

setupUserAndLoginFunction · 0.85
setupTestEnvFunction · 0.70

Tested by 4

TestSync_EmptyFunction · 0.68
TestSync_onewayFunction · 0.68
TestSync_twowayFunction · 0.68
TestSyncFunction · 0.68