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

Function TestCustomTransferBasicConfig

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

Source from the content-addressed store, hash-verified

10)
11
12func TestCustomTransferBasicConfig(t *testing.T) {
13 path := "/path/to/binary"
14 cli, err := lfsapi.NewClient(lfshttp.NewContext(nil, nil, map[string]string{
15 "lfs.customtransfer.testsimple.path": path,
16 }))
17 require.Nil(t, err)
18
19 m := NewManifest(nil, cli, "", "")
20 u := m.NewUploadAdapter("testsimple")
21 assert.NotNil(t, u, "Upload adapter should be present")
22 cu, _ := u.(*customAdapter)
23 assert.NotNil(t, cu, "Upload adapter should be customAdapter")
24 assert.Equal(t, cu.path, path, "Path should be correct")
25 assert.Equal(t, cu.args, "", "args should be blank")
26 assert.Equal(t, cu.concurrent, true, "concurrent should be defaulted")
27
28 d := m.NewDownloadAdapter("testsimple")
29 assert.NotNil(t, d, "Download adapter should be present")
30 cd, _ := u.(*customAdapter)
31 assert.NotNil(t, cd, "Download adapter should be customAdapter")
32 assert.Equal(t, cd.path, path, "Path should be correct")
33 assert.Equal(t, cd.args, "", "args should be blank")
34 assert.Equal(t, cd.concurrent, true, "concurrent should be defaulted")
35}
36
37func TestCustomTransferDownloadConfig(t *testing.T) {
38 path := "/path/to/binary"

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected