MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / TestManagerGetState

Function TestManagerGetState

internal/loop/manager_test.go:108–131  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

106}
107
108func TestManagerGetState(t *testing.T) {
109 tmpDir := t.TempDir()
110 prdPath := createTestPRDWithName(t, tmpDir, "test-prd")
111
112 m := NewManager(10, testProvider)
113 m.Register("test-prd", prdPath)
114
115 state, iteration, err := m.GetState("test-prd")
116 if err != nil {
117 t.Fatalf("unexpected error: %v", err)
118 }
119 if state != LoopStateReady {
120 t.Errorf("expected Ready state, got %v", state)
121 }
122 if iteration != 0 {
123 t.Errorf("expected iteration 0, got %d", iteration)
124 }
125
126 // Non-existent PRD
127 _, _, err = m.GetState("non-existent")
128 if err == nil {
129 t.Error("expected error for non-existent PRD")
130 }
131}
132
133func TestManagerGetAllInstances(t *testing.T) {
134 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 4

RegisterMethod · 0.95
GetStateMethod · 0.95
createTestPRDWithNameFunction · 0.85
NewManagerFunction · 0.85

Tested by

no test coverage detected