MCPcopy Index your code
hub / github.com/Shopify/toxiproxy / TestAddProxyToCollection

Function TestAddProxyToCollection

proxy_collection_test.go:11–27  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestAddProxyToCollection(t *testing.T) {
12 collection := toxiproxy.NewProxyCollection()
13 proxy := NewTestProxy("test", "localhost:20000")
14
15 if _, err := collection.Get(proxy.Name); err == nil {
16 t.Error("Expected proxies to be empty")
17 }
18
19 err := collection.Add(proxy, false)
20 if err != nil {
21 t.Error("Expected to be able to add first proxy to collection")
22 }
23
24 if _, err := collection.Get(proxy.Name); err != nil {
25 t.Error("Expected proxy to be added to map")
26 }
27}
28
29func TestAddTwoProxiesToCollection(t *testing.T) {
30 collection := toxiproxy.NewProxyCollection()

Callers

nothing calls this directly

Calls 4

GetMethod · 0.95
AddMethod · 0.95
NewTestProxyFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…