(x *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestCreateProxy(x *testing.T) { |
| 13 | t := openTopom() |
| 14 | defer t.Close() |
| 15 | |
| 16 | check := func(tokens []string) { |
| 17 | ctx, err := t.newContext() |
| 18 | assert.MustNoError(err) |
| 19 | assert.Must(len(ctx.proxy) == len(tokens)) |
| 20 | for _, t := range tokens { |
| 21 | assert.Must(ctx.proxy[t] != nil) |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | p1, c1 := openProxy() |
| 26 | defer c1.Shutdown() |
| 27 | |
| 28 | check([]string{}) |
| 29 | assert.MustNoError(t.CreateProxy(p1.AdminAddr)) |
| 30 | check([]string{p1.Token}) |
| 31 | assert.Must(t.CreateProxy(p1.AdminAddr) != nil) |
| 32 | check([]string{p1.Token}) |
| 33 | |
| 34 | p2, c2 := openProxy() |
| 35 | defer c2.Shutdown() |
| 36 | |
| 37 | assert.MustNoError(c2.Shutdown()) |
| 38 | check([]string{p1.Token}) |
| 39 | assert.Must(t.CreateProxy(p2.AdminAddr) != nil) |
| 40 | check([]string{p1.Token}) |
| 41 | |
| 42 | assert.MustNoError(c1.Shutdown()) |
| 43 | check([]string{p1.Token}) |
| 44 | } |
| 45 | |
| 46 | func TestRemoveProxy(x *testing.T) { |
| 47 | t := openTopom() |
nothing calls this directly
no test coverage detected