(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestSSHCacheResolveFromCache(t *testing.T) { |
| 13 | ssh := newFakeResolver() |
| 14 | cache := withSSHCache(ssh).(*sshCache) |
| 15 | cache.endpoints["userandhost//1//path//post"] = &sshAuthResponse{ |
| 16 | Href: "cache", |
| 17 | createdAt: time.Now(), |
| 18 | } |
| 19 | ssh.responses["userandhost"] = sshAuthResponse{Href: "real"} |
| 20 | |
| 21 | e := Endpoint{ |
| 22 | SSHMetadata: sshp.SSHMetadata{ |
| 23 | UserAndHost: "userandhost", |
| 24 | Port: "1", |
| 25 | Path: "path", |
| 26 | }, |
| 27 | } |
| 28 | |
| 29 | res, err := cache.Resolve(e, "post") |
| 30 | assert.Nil(t, err) |
| 31 | assert.Equal(t, "cache", res.Href) |
| 32 | } |
| 33 | |
| 34 | func TestSSHCacheResolveFromCacheWithFutureExpiresAt(t *testing.T) { |
| 35 | ssh := newFakeResolver() |
nothing calls this directly
no test coverage detected