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

Function TestValidateAgentConfig

pkg/config/loader_test.go:475–562  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

473}
474
475func TestValidateAgentConfig(t *testing.T) {
476 loader := NewLoader()
477
478 tests := []struct {
479 name string
480 config *types.AgentConfig
481 expectError bool
482 }{
483 {
484 name: "valid config",
485 config: &types.AgentConfig{
486 TemplateID: "test-template",
487 },
488 expectError: false,
489 },
490 {
491 name: "missing template_id",
492 config: &types.AgentConfig{
493 AgentID: "test-agent",
494 },
495 expectError: true,
496 },
497 {
498 name: "valid with model config",
499 config: &types.AgentConfig{
500 TemplateID: "test-template",
501 ModelConfig: &types.ModelConfig{
502 Provider: "anthropic",
503 Model: "claude-3-5-sonnet",
504 },
505 },
506 expectError: false,
507 },
508 {
509 name: "invalid model config - missing provider",
510 config: &types.AgentConfig{
511 TemplateID: "test-template",
512 ModelConfig: &types.ModelConfig{
513 Model: "claude-3-5-sonnet",
514 },
515 },
516 expectError: true,
517 },
518 {
519 name: "invalid model config - missing model",
520 config: &types.AgentConfig{
521 TemplateID: "test-template",
522 ModelConfig: &types.ModelConfig{
523 Provider: "anthropic",
524 },
525 },
526 expectError: true,
527 },
528 {
529 name: "multitenancy enabled with org_id",
530 config: &types.AgentConfig{
531 TemplateID: "test-template",
532 Multitenancy: &types.MultitenancyConfig{

Callers

nothing calls this directly

Calls 4

validateAgentConfigMethod · 0.95
NewLoaderFunction · 0.70
ErrorMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected