MCPcopy Create free account
hub / github.com/pion/ice / TestWithLocalCredentials

Function TestWithLocalCredentials

agent_options_test.go:250–266  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

248}
249
250func TestWithLocalCredentials(t *testing.T) {
251 password := strings.Repeat("p", 16)
252
253 agent, err := NewAgentWithOptions(WithLocalCredentials("abcd", password))
254 require.NoError(t, err)
255 defer agent.Close() //nolint:errcheck
256
257 assert.Equal(t, "abcd", agent.localUfrag)
258 assert.Equal(t, password, agent.localPwd)
259
260 _, err = NewAgentWithOptions(WithLocalCredentials("ab", password))
261 assert.ErrorIs(t, err, ErrLocalUfragInsufficientBits)
262
263 shortPassword := strings.Repeat("p", 10)
264 _, err = NewAgentWithOptions(WithLocalCredentials("abcd", shortPassword))
265 assert.ErrorIs(t, err, ErrLocalPwdInsufficientBits)
266}
267
268func TestWithMuxOptions(t *testing.T) {
269 tcpMux := &stubTCPMux{}

Callers

nothing calls this directly

Calls 4

NewAgentWithOptionsFunction · 0.85
WithLocalCredentialsFunction · 0.85
CloseMethod · 0.65
EqualMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…