(t *testing.T)
| 32 | } |
| 33 | |
| 34 | func TestSSHCacheResolveFromCacheWithFutureExpiresAt(t *testing.T) { |
| 35 | ssh := newFakeResolver() |
| 36 | cache := withSSHCache(ssh).(*sshCache) |
| 37 | cache.endpoints["userandhost//1//path//post"] = &sshAuthResponse{ |
| 38 | Href: "cache", |
| 39 | ExpiresAt: time.Now().Add(time.Duration(1) * time.Hour), |
| 40 | createdAt: time.Now(), |
| 41 | } |
| 42 | ssh.responses["userandhost"] = sshAuthResponse{Href: "real"} |
| 43 | |
| 44 | e := Endpoint{ |
| 45 | SSHMetadata: sshp.SSHMetadata{ |
| 46 | UserAndHost: "userandhost", |
| 47 | Port: "1", |
| 48 | Path: "path", |
| 49 | }, |
| 50 | } |
| 51 | |
| 52 | res, err := cache.Resolve(e, "post") |
| 53 | assert.Nil(t, err) |
| 54 | assert.Equal(t, "cache", res.Href) |
| 55 | } |
| 56 | |
| 57 | func TestSSHCacheResolveFromCacheWithFutureExpiresIn(t *testing.T) { |
| 58 | ssh := newFakeResolver() |
nothing calls this directly
no test coverage detected