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

Function TestSSHCacheResolveFromCacheWithFutureExpiresAt

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

Source from the content-addressed store, hash-verified

32}
33
34func 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
57func TestSSHCacheResolveFromCacheWithFutureExpiresIn(t *testing.T) {
58 ssh := newFakeResolver()

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected