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

Function TestCmdUpdateTaskWaiting

internal/app/update_test.go:299–319  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

297}
298
299func TestCmdUpdateTaskWaiting(t *testing.T) {
300 setupFlowRoot(t)
301 seedTask(t, "ut-wait")
302
303 if rc := cmdUpdate([]string{"task", "ut-wait", "--waiting", "Bob"}); rc != 0 {
304 t.Fatalf("set rc=%d", rc)
305 }
306 db := openFlowDB(t)
307 task, _ := flowdb.GetTask(db, "ut-wait")
308 if !task.WaitingOn.Valid || task.WaitingOn.String != "Bob" {
309 t.Errorf("waiting_on = %+v, want Bob", task.WaitingOn)
310 }
311
312 if rc := cmdUpdate([]string{"task", "ut-wait", "--clear-waiting"}); rc != 0 {
313 t.Fatalf("clear rc=%d", rc)
314 }
315 task, _ = flowdb.GetTask(db, "ut-wait")
316 if task.WaitingOn.Valid {
317 t.Errorf("waiting_on should be NULL after clear, got %q", task.WaitingOn.String)
318 }
319}
320
321func TestCmdUpdateTaskWaitingMutuallyExclusive(t *testing.T) {
322 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