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

Function TestCustomTransferDownloadConfig

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

Source from the content-addressed store, hash-verified

35}
36
37func TestCustomTransferDownloadConfig(t *testing.T) {
38 path := "/path/to/binary"
39 args := "-c 1 --whatever"
40 cli, err := lfsapi.NewClient(lfshttp.NewContext(nil, nil, map[string]string{
41 "lfs.customtransfer.testdownload.path": path,
42 "lfs.customtransfer.testdownload.args": args,
43 "lfs.customtransfer.testdownload.concurrent": "false",
44 "lfs.customtransfer.testdownload.direction": "download",
45 }))
46 require.Nil(t, err)
47
48 m := NewManifest(nil, cli, "", "")
49 u := m.NewUploadAdapter("testdownload")
50 assert.NotNil(t, u, "Upload adapter should always be created")
51 cu, _ := u.(*customAdapter)
52 assert.Nil(t, cu, "Upload adapter should NOT be custom (default to basic)")
53
54 d := m.NewDownloadAdapter("testdownload")
55 assert.NotNil(t, d, "Download adapter should be present")
56 cd, _ := d.(*customAdapter)
57 assert.NotNil(t, cd, "Download adapter should be customAdapter")
58 assert.Equal(t, cd.path, path, "Path should be correct")
59 assert.Equal(t, cd.args, args, "args should be correct")
60 assert.Equal(t, cd.concurrent, false, "concurrent should be set")
61}
62
63func TestCustomTransferUploadConfig(t *testing.T) {
64 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