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

Function TestContainsRemoteInvalid

onecache/onecache_rpc_test.go:98–117  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

96}
97
98func TestContainsRemoteInvalid(t *testing.T) {
99 nodes, err := connectedTestNodes(2, 1)
100 defer tearDownNodes(nodes)
101 if err != nil {
102 t.Fatalf("connectedTestNodes(2, 1) failed: %v", err)
103 }
104
105 n1 := nodes[0]
106 n2 := nodes[1]
107
108 var resp bool
109 args := StorageArgs{Key: "foo", ExplicitPeer: n2.name}
110 if err := n1.server.Contains(args, &resp); err != nil {
111 t.Fatalf("Contains(%+v) returned an error: %v", args, err)
112 }
113
114 if resp {
115 t.Errorf("Contains(%+v) returned %v; want false", args, resp)
116 }
117}
118
119func TestTouchRemote(t *testing.T) {
120 nodes, err := connectedTestNodes(2, 1)

Callers

nothing calls this directly

Calls 3

connectedTestNodesFunction · 0.85
tearDownNodesFunction · 0.85
ContainsMethod · 0.45

Tested by

no test coverage detected