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

Function TestDefaultOptions

pkg/asteros/asteros_test.go:403–441  ·  view source on GitHub ↗

TestDefaultOptions 测试默认配置

(t *testing.T)

Source from the content-addressed store, hash-verified

401
402// TestDefaultOptions 测试默认配置
403func TestDefaultOptions(t *testing.T) {
404 opts := DefaultOptions()
405
406 if opts.Name != "AsterOS" {
407 t.Errorf("Expected default name 'AsterOS', got '%s'", opts.Name)
408 }
409
410 if opts.Port != 8080 {
411 t.Errorf("Expected default port 8080, got %d", opts.Port)
412 }
413
414 if !opts.AutoDiscover {
415 t.Error("Expected auto discovery to be enabled by default")
416 }
417
418 if !opts.EnableCORS {
419 t.Error("Expected CORS to be enabled by default")
420 }
421
422 if opts.EnableAuth {
423 t.Error("Expected auth to be disabled by default")
424 }
425
426 if !opts.EnableMetrics {
427 t.Error("Expected metrics to be enabled by default")
428 }
429
430 if !opts.EnableHealth {
431 t.Error("Expected health check to be enabled by default")
432 }
433
434 if !opts.EnableLogging {
435 t.Error("Expected logging to be enabled by default")
436 }
437
438 if opts.LogLevel != "info" {
439 t.Errorf("Expected default log level 'info', got '%s'", opts.LogLevel)
440 }
441}
442
443// TestOptionsValidation 测试配置验证
444func TestOptionsValidation(t *testing.T) {

Callers

nothing calls this directly

Calls 2

DefaultOptionsFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected