MCPcopy Index your code
hub / github.com/coder/coder / TestRedactURL

Function TestRedactURL

coderd/x/chatd/mcpclient/mcpclient_test.go:870–892  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

868}
869
870func TestRedactURL(t *testing.T) {
871 t.Parallel()
872
873 tests := []struct {
874 name string
875 input string
876 expected string
877 }{
878 {"plain", "https://mcp.example.com/v1", "https://mcp.example.com/v1"},
879 {"with userinfo", "https://user:secret@mcp.example.com/v1", "https://mcp.example.com/v1"},
880 {"with query params", "https://mcp.example.com/v1?api_key=sk-123", "https://mcp.example.com/v1"},
881 {"with both", "https://user:pass@host/p?key=val", "https://host/p"},
882 {"invalid url", "://not-a-url", "://not-a-url"},
883 }
884
885 for _, tt := range tests {
886 t.Run(tt.name, func(t *testing.T) {
887 t.Parallel()
888 got := mcpclient.RedactURL(tt.input)
889 assert.Equal(t, tt.expected, got)
890 })
891 }
892}
893
894func TestConnectAll_ExpiredToken(t *testing.T) {
895 t.Parallel()

Callers

nothing calls this directly

Calls 3

RedactURLFunction · 0.92
RunMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected