(t *testing.T)
| 61 | } |
| 62 | |
| 63 | func TestCustomTransferUploadConfig(t *testing.T) { |
| 64 | path := "/path/to/binary" |
| 65 | args := "-c 1 --whatever" |
| 66 | cli, err := lfsapi.NewClient(lfshttp.NewContext(nil, nil, map[string]string{ |
| 67 | "lfs.customtransfer.testupload.path": path, |
| 68 | "lfs.customtransfer.testupload.args": args, |
| 69 | "lfs.customtransfer.testupload.concurrent": "false", |
| 70 | "lfs.customtransfer.testupload.direction": "upload", |
| 71 | })) |
| 72 | require.Nil(t, err) |
| 73 | |
| 74 | m := NewManifest(nil, cli, "", "") |
| 75 | d := m.NewDownloadAdapter("testupload") |
| 76 | assert.NotNil(t, d, "Download adapter should always be created") |
| 77 | cd, _ := d.(*customAdapter) |
| 78 | assert.Nil(t, cd, "Download adapter should NOT be custom (default to basic)") |
| 79 | |
| 80 | u := m.NewUploadAdapter("testupload") |
| 81 | assert.NotNil(t, u, "Upload adapter should be present") |
| 82 | cu, _ := u.(*customAdapter) |
| 83 | assert.NotNil(t, cu, "Upload adapter should be customAdapter") |
| 84 | assert.Equal(t, cu.path, path, "Path should be correct") |
| 85 | assert.Equal(t, cu.args, args, "args should be correct") |
| 86 | assert.Equal(t, cu.concurrent, false, "concurrent should be set") |
| 87 | } |
| 88 | |
| 89 | func TestCustomTransferBothConfig(t *testing.T) { |
| 90 | path := "/path/to/binary" |
nothing calls this directly
no test coverage detected