MCPcopy Create free account
hub / github.com/Facets-cloud/flow / TestCmdUpdateTaskBothFields

Function TestCmdUpdateTaskBothFields

internal/app/update_test.go:145–162  ·  view source on GitHub ↗

TestCmdUpdateTaskBothFields exercises combining multiple field- changing flags in one call.

(t *testing.T)

Source from the content-addressed store, hash-verified

143// TestCmdUpdateTaskBothFields exercises combining multiple field-
144// changing flags in one call.
145func TestCmdUpdateTaskBothFields(t *testing.T) {
146 setupFlowRoot(t)
147 seedTask(t, "ut-both")
148
149 newDir := filepath.Join(t.TempDir(), "combo")
150 if rc := cmdUpdate([]string{"task", "ut-both",
151 "--priority", "high", "--work-dir", newDir, "--mkdir"}); rc != 0 {
152 t.Fatalf("rc=%d", rc)
153 }
154 db := openFlowDB(t)
155 task, _ := flowdb.GetTask(db, "ut-both")
156 if task.Priority != "high" {
157 t.Errorf("priority = %q, want high", task.Priority)
158 }
159 if task.WorkDir != newDir {
160 t.Errorf("work_dir = %q, want %q", task.WorkDir, newDir)
161 }
162}
163
164func TestCmdUpdateTaskRequiresFlag(t *testing.T) {
165 setupFlowRoot(t)

Callers

nothing calls this directly

Calls 5

GetTaskFunction · 0.92
setupFlowRootFunction · 0.85
seedTaskFunction · 0.85
cmdUpdateFunction · 0.85
openFlowDBFunction · 0.85

Tested by

no test coverage detected