MCPcopy
hub / github.com/CodisLabs/codis / openProxy

Function openProxy

pkg/topom/topom_test.go:53–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

51}
52
53func openProxy() (*models.Proxy, *proxy.ApiClient) {
54 config := proxy.NewDefaultConfig()
55 config.AdminAddr = "0.0.0.0:0"
56 config.ProxyAddr = "0.0.0.0:0"
57 config.ProductName = "topom_test"
58 config.ProductAuth = "topom_auth"
59 config.ProxyHeapPlaceholder = 0
60 config.ProxyMaxOffheapBytes = 0
61
62 s, err := proxy.New(config)
63 assert.MustNoError(err)
64
65 c := proxy.NewApiClient(s.Model().AdminAddr)
66 c.SetXAuth(config.ProductName, config.ProductAuth, s.Model().Token)
67
68 p, err := c.Model()
69 assert.MustNoError(err)
70 return p, c
71}
72
73func TestTopomClose(x *testing.T) {
74 t := openTopom()

Callers 10

TestGroupPromoteFunction · 0.70
TestCreateProxyFunction · 0.70
TestRemoveProxyFunction · 0.70
TestSlotActionPendingFunction · 0.70
TestSlotActionPreparingFunction · 0.70
TestSlotActionPreparedFunction · 0.70
TestSlotActionMigratingFunction · 0.70
TestSlotActionFinishedFunction · 0.70
TestApiProxyFunction · 0.70
TestProxyStatsFunction · 0.70

Calls 3

SetXAuthMethod · 0.95
ModelMethod · 0.95
ModelMethod · 0.45

Tested by

no test coverage detected