(x *testing.T)
| 91 | } |
| 92 | |
| 93 | func TestProxyCache(x *testing.T) { |
| 94 | t := openTopom() |
| 95 | defer t.Close() |
| 96 | |
| 97 | const token = "fake_proxy_token" |
| 98 | |
| 99 | check := func(exists bool) { |
| 100 | ctx, err := t.newContext() |
| 101 | assert.MustNoError(err) |
| 102 | if !exists { |
| 103 | assert.Must(ctx.proxy[token] == nil) |
| 104 | } else { |
| 105 | p, err := ctx.getProxy(token) |
| 106 | assert.MustNoError(err) |
| 107 | assert.Must(p.Token == token) |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | p := &models.Proxy{Token: token} |
| 112 | check(false) |
| 113 | |
| 114 | t.dirtyProxyCache(p.Token) |
| 115 | assert.MustNoError(t.storeCreateProxy(p)) |
| 116 | check(true) |
| 117 | |
| 118 | t.dirtyProxyCache(p.Token) |
| 119 | assert.MustNoError(t.storeRemoveProxy(p)) |
| 120 | check(false) |
| 121 | } |
| 122 | |
| 123 | func contextUpdateSlotMapping(t *Topom, m *models.SlotMapping) { |
| 124 | t.dirtySlotsCache(m.Id) |
nothing calls this directly
no test coverage detected