(t *testing.T)
| 142 | } |
| 143 | |
| 144 | func TestAdapterRegButBasicOnly(t *testing.T) { |
| 145 | cli, err := lfsapi.NewClient(lfshttp.NewContext(nil, nil, map[string]string{ |
| 146 | "lfs.basictransfersonly": "yes", |
| 147 | })) |
| 148 | require.Nil(t, err) |
| 149 | |
| 150 | m := NewManifest(nil, cli, "", "") |
| 151 | |
| 152 | assert := assert.New(t) |
| 153 | |
| 154 | m.RegisterNewAdapterFunc("test", Upload, newTestAdapter) |
| 155 | m.RegisterNewAdapterFunc("test", Download, newTestAdapter) |
| 156 | // Will still be created if we ask for them |
| 157 | da := m.NewDownloadAdapter("test") |
| 158 | if assert.NotNil(da) { |
| 159 | assert.Equal("test", da.Name()) |
| 160 | assert.Equal(Download, da.Direction()) |
| 161 | } |
| 162 | |
| 163 | ua := m.NewUploadAdapter("test") |
| 164 | if assert.NotNil(ua) { |
| 165 | assert.Equal("test", ua.Name()) |
| 166 | assert.Equal(Upload, ua.Direction()) |
| 167 | } |
| 168 | |
| 169 | // But list will exclude |
| 170 | ld := m.GetDownloadAdapterNames() |
| 171 | assert.Equal([]string{"basic"}, ld) |
| 172 | lu := m.GetUploadAdapterNames() |
| 173 | assert.Equal([]string{"basic"}, lu) |
| 174 | } |
nothing calls this directly
no test coverage detected