MCPcopy
hub / github.com/git-lfs/git-lfs / TestSSHCacheResolveFromCacheWithFutureExpiresIn

Function TestSSHCacheResolveFromCacheWithFutureExpiresIn

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

Source from the content-addressed store, hash-verified

55}
56
57func 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
80func TestSSHCacheResolveFromCacheWithPastExpiresAt(t *testing.T) {
81 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