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

Function TestCustomTransferBothConfig

tq/custom_test.go:89–116  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

87}
88
89func TestCustomTransferBothConfig(t *testing.T) {
90 path := "/path/to/binary"
91 args := "-c 1 --whatever --yeah"
92 cli, err := lfsapi.NewClient(lfshttp.NewContext(nil, nil, map[string]string{
93 "lfs.customtransfer.testboth.path": path,
94 "lfs.customtransfer.testboth.args": args,
95 "lfs.customtransfer.testboth.concurrent": "yes",
96 "lfs.customtransfer.testboth.direction": "both",
97 }))
98 require.Nil(t, err)
99
100 m := NewManifest(nil, cli, "", "")
101 d := m.NewDownloadAdapter("testboth")
102 assert.NotNil(t, d, "Download adapter should be present")
103 cd, _ := d.(*customAdapter)
104 assert.NotNil(t, cd, "Download adapter should be customAdapter")
105 assert.Equal(t, cd.path, path, "Path should be correct")
106 assert.Equal(t, cd.args, args, "args should be correct")
107 assert.Equal(t, cd.concurrent, true, "concurrent should be set")
108
109 u := m.NewUploadAdapter("testboth")
110 assert.NotNil(t, u, "Upload adapter should be present")
111 cu, _ := u.(*customAdapter)
112 assert.NotNil(t, cu, "Upload adapter should be customAdapter")
113 assert.Equal(t, cu.path, path, "Path should be correct")
114 assert.Equal(t, cu.args, args, "args should be correct")
115 assert.Equal(t, cu.concurrent, true, "concurrent should be set")
116}

Callers

nothing calls this directly

Calls 6

NewDownloadAdapterMethod · 0.95
NewUploadAdapterMethod · 0.95
NewClientFunction · 0.92
NewContextFunction · 0.92
NewManifestFunction · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected