MCPcopy Index your code
hub / github.com/git-lfs/git-lfs / TestSSHCacheResolveFromCacheWithPastExpiresIn

Function TestSSHCacheResolveFromCacheWithPastExpiresIn

lfshttp/ssh_test.go:103–124  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

101}
102
103func 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
126func TestSSHCacheResolveFromCacheWithAmbiguousExpirationInfo(t *testing.T) {
127 ssh := newFakeResolver()

Callers

nothing calls this directly

Calls 4

newFakeResolverFunction · 0.85
withSSHCacheFunction · 0.85
ResolveMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected