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

Function TestCredentialsMap_RoundTrip

cli/sessionstore/sessionstore_internal_test.go:100–121  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

98}
99
100func TestCredentialsMap_RoundTrip(t *testing.T) {
101 t.Parallel()
102
103 creds := credentialsMap{
104 "coder1.example.com": {
105 CoderURL: "coder1.example.com",
106 APIToken: "token1",
107 },
108 "coder2.example.com:8080": {
109 CoderURL: "coder2.example.com:8080",
110 APIToken: "token2",
111 },
112 }
113
114 jsonData, err := json.Marshal(creds)
115 require.NoError(t, err)
116
117 parsed, err := parseCredentialsJSON(jsonData)
118 require.NoError(t, err)
119
120 require.Equal(t, creds, parsed)
121}

Callers

nothing calls this directly

Calls 3

parseCredentialsJSONFunction · 0.85
MarshalMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected