(t *testing.T)
| 101 | } |
| 102 | |
| 103 | func TestSSHCacheResolveFromCacheWithPastExpiresIn(t *testing.T) { |
| 104 | ssh := newFakeResolver() |
| 105 | cache := withSSHCache(ssh).(*sshCache) |
| 106 | cache.endpoints["userandhost//1//path//post"] = &sshAuthResponse{ |
| 107 | Href: "cache", |
| 108 | ExpiresIn: -60 * 60, |
| 109 | createdAt: time.Now(), |
| 110 | } |
| 111 | ssh.responses["userandhost"] = sshAuthResponse{Href: "real"} |
| 112 | |
| 113 | e := Endpoint{ |
| 114 | SSHMetadata: sshp.SSHMetadata{ |
| 115 | UserAndHost: "userandhost", |
| 116 | Port: "1", |
| 117 | Path: "path", |
| 118 | }, |
| 119 | } |
| 120 | |
| 121 | res, err := cache.Resolve(e, "post") |
| 122 | assert.Nil(t, err) |
| 123 | assert.Equal(t, "real", res.Href) |
| 124 | } |
| 125 | |
| 126 | func TestSSHCacheResolveFromCacheWithAmbiguousExpirationInfo(t *testing.T) { |
| 127 | ssh := newFakeResolver() |
nothing calls this directly
no test coverage detected