MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / TestServer_AuthEnabled

Function TestServer_AuthEnabled

pkg/mcp/server_test.go:51–60  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

49}
50
51func TestServer_AuthEnabled(t *testing.T) {
52 cfg := &Config{Host: "127.0.0.1", Port: 8080, AuthToken: "testtoken"}
53 if !cfg.AuthEnabled() {
54 t.Error("Config with AuthToken should have auth enabled")
55 }
56 srv := New(cfg)
57 if srv == nil {
58 t.Fatal("New() returned nil")
59 }
60}
61
62// freePort asks the OS for an available TCP port on localhost.
63func freePort(t *testing.T) int {

Callers

nothing calls this directly

Calls 3

AuthEnabledMethod · 0.95
NewFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected