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

Function TestSSHCacheResolveFromCache

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

Source from the content-addressed store, hash-verified

10)
11
12func TestSSHCacheResolveFromCache(t *testing.T) {
13 ssh := newFakeResolver()
14 cache := withSSHCache(ssh).(*sshCache)
15 cache.endpoints["userandhost//1//path//post"] = &sshAuthResponse{
16 Href: "cache",
17 createdAt: time.Now(),
18 }
19 ssh.responses["userandhost"] = sshAuthResponse{Href: "real"}
20
21 e := Endpoint{
22 SSHMetadata: sshp.SSHMetadata{
23 UserAndHost: "userandhost",
24 Port: "1",
25 Path: "path",
26 },
27 }
28
29 res, err := cache.Resolve(e, "post")
30 assert.Nil(t, err)
31 assert.Equal(t, "cache", res.Href)
32}
33
34func TestSSHCacheResolveFromCacheWithFutureExpiresAt(t *testing.T) {
35 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