MCPcopy Create free account
hub / github.com/cronitorio/cronitor-cli / TestCreateDefaultNameAutoDiscover

Function TestCreateDefaultNameAutoDiscover

cmd/discover_test.go:205–221  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

203}
204
205func TestCreateDefaultNameAutoDiscover(t *testing.T) {
206 line := &lib.Line{
207 CommandToRun: "cronitor d3x0c1 cronitor discover --auto /discover/test",
208 LineNumber: 11,
209 RunAs: "",
210 }
211 crontab := &lib.Crontab{
212 Filename: "/discover/test",
213 }
214
215 defaultName := createDefaultName(line, crontab, "localhost", nil, map[string]bool{})
216
217 expected := "[localhost] Auto discover /discover/test"
218 if defaultName != expected {
219 t.Errorf("Auto discover test failed, got: %s, expected: %s.", defaultName, expected)
220 }
221}

Callers

nothing calls this directly

Calls 1

createDefaultNameFunction · 0.85

Tested by

no test coverage detected