MCPcopy Create free account
hub / github.com/Azure/peerd / TestHTTPClientFor

Function TestHTTPClientFor

pkg/peernet/network_test.go:91–111  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

89}
90
91func TestHTTPClientFor(t *testing.T) {
92 h := &mocks.MockHost{PeerStore: &mocks.MockPeerstore{}}
93
94 n, err := New(h)
95 if err != nil {
96 t.Fatal(err)
97 }
98
99 c := n.HTTPClientFor("test-peer")
100 if c == nil {
101 t.Fatal("expected non-nil client")
102 }
103
104 if c.Transport == nil {
105 t.Fatal("expected non-nil transport")
106 }
107
108 if c.Timeout == 0 {
109 t.Fatal("expected non-zero timeout")
110 }
111}
112
113func TestRoundTripperFor(t *testing.T) {
114 h := &mocks.MockHost{PeerStore: &mocks.MockPeerstore{}}

Callers

nothing calls this directly

Calls 2

NewFunction · 0.70
HTTPClientForMethod · 0.65

Tested by

no test coverage detected