MCPcopy Create free account
hub / github.com/celer-pkg/celer / newInitializedCeler

Function newInitializedCeler

cmds/cmd_test.go:43–55  ·  view source on GitHub ↗

newInitializedCeler returns a Celer that has been Init'd and has a freshly cloned conf repo — the minimum state required for configureCmd's checkIfInitialized() to pass. Every cmd.Execute()-style test needs this.

(t *testing.T)

Source from the content-addressed store, hash-verified

41// cloned conf repo — the minimum state required for configureCmd's
42// checkIfInitialized() to pass. Every cmd.Execute()-style test needs this.
43func newInitializedCeler(t *testing.T) *configs.Celer {
44 t.Helper()
45 dirs.RemoveAllForTest()
46
47 celer := configs.NewCeler()
48 if err := celer.Init(); err != nil {
49 t.Fatal(err)
50 }
51 if err := celer.CloneConf(test_conf_repo_url, test_conf_repo_branch, true); err != nil {
52 t.Fatal(err)
53 }
54 return celer
55}
56
57// runCommand builds the cobra command from `command`, feeds it `args` just
58// like a user would on the shell, captures everything the command writes to

Calls 4

InitMethod · 0.95
CloneConfMethod · 0.95
RemoveAllForTestFunction · 0.92
NewCelerFunction · 0.92

Tested by

no test coverage detected