(c *C)
| 87 | } |
| 88 | |
| 89 | func (s *ChangesSuite) TestImportChangesFiles(c *C) { |
| 90 | repo := NewLocalRepo("test", "Test Comment") |
| 91 | c.Assert(s.localRepoCollection.Add(repo), IsNil) |
| 92 | |
| 93 | origFailedFiles := []string{ |
| 94 | "testdata/changes/calamares.changes", |
| 95 | "testdata/changes/hardlink_0.2.1-invalidfiles_amd64.changes", |
| 96 | "testdata/changes/hardlink_0.2.1-invalidsig_amd64.changes", |
| 97 | "testdata/changes/hardlink_0.2.0_i386.deb", |
| 98 | } |
| 99 | origProcessedFiles := []string{ |
| 100 | "testdata/changes/hardlink_0.2.1.dsc", |
| 101 | "testdata/changes/hardlink_0.2.1.tar.gz", |
| 102 | "testdata/changes/hardlink_0.2.1_amd64.deb", |
| 103 | "testdata/changes/hardlink_0.2.1_amd64.buildinfo", |
| 104 | "testdata/changes/hardlink_0.2.1_amd64.changes", |
| 105 | } |
| 106 | |
| 107 | var expectedProcessedFiles, expectedFailedFiles []string |
| 108 | |
| 109 | for _, path := range origFailedFiles { |
| 110 | filename := filepath.Join(s.Dir, filepath.Base(path)) |
| 111 | _ = utils.CopyFile(path, filename) |
| 112 | expectedFailedFiles = append(expectedFailedFiles, filename) |
| 113 | } |
| 114 | |
| 115 | for _, path := range origProcessedFiles { |
| 116 | filename := filepath.Join(s.Dir, filepath.Base(path)) |
| 117 | _ = utils.CopyFile(path, filename) |
| 118 | expectedProcessedFiles = append(expectedProcessedFiles, filename) |
| 119 | } |
| 120 | |
| 121 | changesFiles, failedFiles := CollectChangesFiles([]string{s.Dir}, s.Reporter) |
| 122 | c.Check(failedFiles, HasLen, 0) |
| 123 | |
| 124 | processedFiles, failedFiles, err := ImportChangesFiles( |
| 125 | append(changesFiles, "testdata/changes/notexistent.changes"), |
| 126 | s.Reporter, true, true, false, false, &NullVerifier{}, |
| 127 | template.Must(template.New("test").Parse("test")), s.progress, s.localRepoCollection, s.packageCollection, s.packagePool, func(database.ReaderWriter) aptly.ChecksumStorage { return s.checksumStorage }, |
| 128 | nil, nil) |
| 129 | c.Assert(err, IsNil) |
| 130 | c.Check(failedFiles, DeepEquals, append(expectedFailedFiles, "testdata/changes/notexistent.changes")) |
| 131 | c.Check(processedFiles, DeepEquals, expectedProcessedFiles) |
| 132 | } |
| 133 | |
| 134 | func (s *ChangesSuite) TestImportDbgsymWithVersionedSourceField(c *C) { |
| 135 | repo := NewLocalRepo("test", "Test Comment") |
nothing calls this directly
no test coverage detected