MCPcopy Index your code
hub / github.com/go-task/task / TestHTTPNode_CacheKey

Function TestHTTPNode_CacheKey

taskfile/node_http_test.go:21–60  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

19)
20
21func TestHTTPNode_CacheKey(t *testing.T) {
22 t.Parallel()
23
24 tests := []struct {
25 entrypoint string
26 expectedKey string
27 }{
28 {
29 entrypoint: "https://github.com",
30 expectedKey: "http.github.com..996e1f714b08e971ec79e3bea686287e66441f043177999a13dbc546d8fe402a",
31 },
32 {
33 entrypoint: "https://github.com/Taskfile.yml",
34 expectedKey: "http.github.com.Taskfile.yml.85b3c3ad71b78dc74e404c7b4390fc13672925cb644a4d26c21b9f97c17b5fc0",
35 },
36 {
37 entrypoint: "https://github.com/foo",
38 expectedKey: "http.github.com.foo.df3158dafc823e6847d9bcaf79328446c4877405e79b100723fa6fd545ed3e2b",
39 },
40 {
41 entrypoint: "https://github.com/foo/Taskfile.yml",
42 expectedKey: "http.github.com.foo.Taskfile.yml.aea946ea7eb6f6bb4e159e8b840b6b50975927778b2e666df988c03bbf10c4c4",
43 },
44 {
45 entrypoint: "https://github.com/foo/bar",
46 expectedKey: "http.github.com.foo.bar.d3514ad1d4daedf9cc2825225070b49ebc8db47fa5177951b2a5b9994597570c",
47 },
48 {
49 entrypoint: "https://github.com/foo/bar/Taskfile.yml",
50 expectedKey: "http.github.com.bar.Taskfile.yml.b9cf01e01e47c0e96ea536e1a8bd7b3a6f6c1f1881bad438990d2bfd4ccd0ac0",
51 },
52 }
53
54 for _, tt := range tests {
55 node, err := NewHTTPNode(tt.entrypoint, "", false)
56 require.NoError(t, err)
57 key := node.CacheKey()
58 assert.Equal(t, tt.expectedKey, key)
59 }
60}
61
62func TestBuildHTTPClient_Default(t *testing.T) {
63 t.Parallel()

Callers

nothing calls this directly

Calls 2

CacheKeyMethod · 0.95
NewHTTPNodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…