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

Function TestUpdateCmd_UpdateProjectRepos_NoTargets

cmds/cmd_update_test.go:372–403  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

370}
371
372func TestUpdateCmd_UpdateProjectRepos_NoTargets(t *testing.T) {
373 // Cleanup.
374 dirs.RemoveAllForTest()
375
376 // Check error.
377 var check = func(err error) {
378 t.Helper()
379 if err != nil {
380 t.Fatal(err)
381 }
382 }
383
384 // Init celer.
385 celer := configs.NewCeler()
386 check(celer.Init())
387 check(celer.CloneConf(test_conf_repo_url, test_conf_repo_branch, true))
388 check(celer.SetBuildType("Release"))
389
390 // Create update command.
391 updateCmd := updateCmd{
392 celer: celer,
393 }
394
395 // Test updating ports with no targets.
396 err := updateCmd.updateProjectRepos([]string{})
397 if err == nil {
398 t.Fatal("updatePorts should return error when no targets specified")
399 }
400 if !strings.Contains(err.Error(), "no ports specified") {
401 t.Errorf("Expected 'no ports specified' error, got: %v", err)
402 }
403}
404
405func TestUpdateCmd_UpdatePortRepo_SrcNotExist(t *testing.T) {
406 // Cleanup.

Callers

nothing calls this directly

Calls 8

InitMethod · 0.95
CloneConfMethod · 0.95
SetBuildTypeMethod · 0.95
updateProjectReposMethod · 0.95
RemoveAllForTestFunction · 0.92
NewCelerFunction · 0.92
checkFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected