(t *testing.T)
| 55 | } |
| 56 | |
| 57 | func TestSSHCacheResolveFromCacheWithFutureExpiresIn(t *testing.T) { |
| 58 | ssh := newFakeResolver() |
| 59 | cache := withSSHCache(ssh).(*sshCache) |
| 60 | cache.endpoints["userandhost//1//path//post"] = &sshAuthResponse{ |
| 61 | Href: "cache", |
| 62 | ExpiresIn: 60 * 60, |
| 63 | createdAt: time.Now(), |
| 64 | } |
| 65 | ssh.responses["userandhost"] = sshAuthResponse{Href: "real"} |
| 66 | |
| 67 | e := Endpoint{ |
| 68 | SSHMetadata: sshp.SSHMetadata{ |
| 69 | UserAndHost: "userandhost", |
| 70 | Port: "1", |
| 71 | Path: "path", |
| 72 | }, |
| 73 | } |
| 74 | |
| 75 | res, err := cache.Resolve(e, "post") |
| 76 | assert.Nil(t, err) |
| 77 | assert.Equal(t, "cache", res.Href) |
| 78 | } |
| 79 | |
| 80 | func TestSSHCacheResolveFromCacheWithPastExpiresAt(t *testing.T) { |
| 81 | ssh := newFakeResolver() |
nothing calls this directly
no test coverage detected