()
| 51 | } |
| 52 | |
| 53 | func 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 | |
| 73 | func TestTopomClose(x *testing.T) { |
| 74 | t := openTopom() |
no test coverage detected