MCPcopy Create free account
hub / github.com/astercloud/aster / TestRegisterWorkflow

Function TestRegisterWorkflow

pkg/asteros/asteros_test.go:201–231  ·  view source on GitHub ↗

TestRegisterWorkflow 测试注册 Workflow

(t *testing.T)

Source from the content-addressed store, hash-verified

199
200// TestRegisterWorkflow 测试注册 Workflow
201func TestRegisterWorkflow(t *testing.T) {
202 deps := createTestDependencies(t)
203 pool := core.NewPool(&core.PoolOptions{
204 Dependencies: deps,
205 MaxAgents: 5,
206 })
207
208 os, err := New(&Options{
209 Name: "TestOS",
210 Port: 8080,
211 Pool: pool,
212 })
213 if err != nil {
214 t.Fatalf("Failed to create AsterOS: %v", err)
215 }
216
217 // 创建 Workflow
218 workflowInstance := &workflow.SequentialAgent{}
219
220 // 注册 Workflow
221 err = os.RegisterWorkflow("test-workflow", workflowInstance)
222 if err != nil {
223 t.Fatalf("Failed to register workflow: %v", err)
224 }
225
226 // 验证 Workflow 已注册
227 _, exists := os.Registry().GetWorkflow("test-workflow")
228 if !exists {
229 t.Error("Workflow not found in registry")
230 }
231}
232
233// TestAddInterface 测试添加 Interface
234func TestAddInterface(t *testing.T) {

Callers

nothing calls this directly

Calls 7

NewPoolFunction · 0.92
createTestDependenciesFunction · 0.85
RegistryMethod · 0.80
NewFunction · 0.70
ErrorMethod · 0.65
RegisterWorkflowMethod · 0.45
GetWorkflowMethod · 0.45

Tested by

no test coverage detected