(t *testing.T)
| 251 | } |
| 252 | |
| 253 | func TestSignCommandChangeListIsCleanedOnError(t *testing.T) { |
| 254 | tmpDir := t.TempDir() |
| 255 | |
| 256 | config.SetDir(tmpDir) |
| 257 | cli := test.NewFakeCli(&fakeClient{}) |
| 258 | cli.SetNotaryClient(notaryfake.GetLoadedNotaryRepository) |
| 259 | cmd := newSignCommand(cli) |
| 260 | cmd.SetArgs([]string{"ubuntu:latest"}) |
| 261 | cmd.SetOut(io.Discard) |
| 262 | cmd.SetErr(io.Discard) |
| 263 | |
| 264 | err := cmd.Execute() |
| 265 | assert.Assert(t, err != nil) |
| 266 | |
| 267 | notaryRepo, err := client.NewFileCachedRepository(tmpDir, "docker.io/library/ubuntu", "https://localhost", nil, testPassRetriever, trustpinning.TrustPinConfig{}) |
| 268 | assert.NilError(t, err) |
| 269 | cl, err := notaryRepo.GetChangelist() |
| 270 | assert.NilError(t, err) |
| 271 | assert.Check(t, is.Equal(len(cl.List()), 0)) |
| 272 | } |
| 273 | |
| 274 | func TestSignCommandLocalFlag(t *testing.T) { |
| 275 | cli := test.NewFakeCli(&fakeClient{}) |
nothing calls this directly
no test coverage detected
searching dependent graphs…