(x *testing.T)
| 44 | } |
| 45 | |
| 46 | func TestRemoveProxy(x *testing.T) { |
| 47 | t := openTopom() |
| 48 | defer t.Close() |
| 49 | |
| 50 | check := func(tokens []string) { |
| 51 | ctx, err := t.newContext() |
| 52 | assert.MustNoError(err) |
| 53 | assert.Must(len(ctx.proxy) == len(tokens)) |
| 54 | for _, t := range tokens { |
| 55 | assert.Must(ctx.proxy[t] != nil) |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | p1, c1 := openProxy() |
| 60 | defer c1.Shutdown() |
| 61 | |
| 62 | check([]string{}) |
| 63 | assert.MustNoError(t.CreateProxy(p1.AdminAddr)) |
| 64 | check([]string{p1.Token}) |
| 65 | assert.MustNoError(t.RemoveProxy(p1.Token, false)) |
| 66 | check([]string{}) |
| 67 | |
| 68 | p2, c2 := openProxy() |
| 69 | defer c2.Shutdown() |
| 70 | |
| 71 | assert.MustNoError(t.CreateProxy(p2.AdminAddr)) |
| 72 | check([]string{p2.Token}) |
| 73 | |
| 74 | assert.MustNoError(c2.Shutdown()) |
| 75 | assert.Must(t.RemoveProxy(p2.Token, false) != nil) |
| 76 | check([]string{p2.Token}) |
| 77 | |
| 78 | assert.MustNoError(t.RemoveProxy(p2.Token, true)) |
| 79 | check([]string{}) |
| 80 | } |
nothing calls this directly
no test coverage detected