MCPcopy Create free account
hub / github.com/dadgar/onecache / TestNewRpcServerAnyPort

Function TestNewRpcServerAnyPort

onecache/onecache_test.go:16–33  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

14}
15
16func TestNewRpcServerAnyPort(t *testing.T) {
17 n := &Node{}
18
19 // A zero value port allows any port binding.
20 err := n.initRpcServer(0)
21
22 if err != nil {
23 t.Error(err)
24 }
25
26 if n.listener == nil {
27 t.Error("newRpcServer(0) did not create a listener")
28 }
29
30 if n.port <= 0 {
31 t.Error("newRpcServer(0) did not bind to an available port")
32 }
33}
34
35func TestStartRpcServerSpecificPort(t *testing.T) {
36 n := &Node{}

Callers

nothing calls this directly

Calls 1

initRpcServerMethod · 0.95

Tested by

no test coverage detected