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

Function TestUpdateCmd_DoUpdate_PortsRepo

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

Source from the content-addressed store, hash-verified

694}
695
696func TestUpdateCmd_DoUpdate_PortsRepo(t *testing.T) {
697 // Cleanup.
698 dirs.RemoveAllForTest()
699
700 // Check error.
701 var check = func(err error) {
702 t.Helper()
703 if err != nil {
704 t.Fatal(err)
705 }
706 }
707
708 // Init celer.
709 celer := configs.NewCeler()
710 check(celer.Init())
711 check(celer.CloneConf(test_conf_repo_url, test_conf_repo_branch, true))
712 check(celer.SetBuildType("Release"))
713
714 // Create update command
715 updateCmd := updateCmd{
716 celer: celer,
717 portsRepo: true,
718 force: true,
719 }
720
721 // Note: This test doesn't actually call doUpdate as it would os.Exit
722 // Instead we test the underlying method directly
723 err := updateCmd.updatePortsRepo()
724 if err != nil {
725 t.Logf("Update ports repo returned: %v (may be acceptable)", err)
726 }
727}

Callers

nothing calls this directly

Calls 7

InitMethod · 0.95
CloneConfMethod · 0.95
SetBuildTypeMethod · 0.95
updatePortsRepoMethod · 0.95
RemoveAllForTestFunction · 0.92
NewCelerFunction · 0.92
checkFunction · 0.85

Tested by

no test coverage detected