Mercurial > treepkg
comparison test/test_packager.py @ 229:653a45adda50
Prepare for svn managed debian rules directories. So far, the directory
names used for a particular revision were of the form <revision>-1 .
Now the second number (which was always 1 up to now) will become the svn
revision of the debian rules directory. As a first step towards that,
the packager classes now support numbers other than 1 as the second
number in the package directory name.
Update the tests accordingly.
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Tue, 13 Jan 2009 13:48:59 +0000 |
parents | 230582ed7329 |
children | e3cda08d2619 |
comparison
equal
deleted
inserted
replaced
228:d2ddd037ddaf | 229:653a45adda50 |
---|---|
190 | 190 |
191 def package_if_updated(self, revision, do_svn_update=True): | 191 def package_if_updated(self, revision, do_svn_update=True): |
192 if self.do_stop: | 192 if self.do_stop: |
193 writefile(self.instructions_file, "stop") | 193 writefile(self.instructions_file, "stop") |
194 if self.do_package: | 194 if self.do_package: |
195 return StoppingPackager(self, 1) | 195 return StoppingPackager(self, 1, 0) |
196 else: | 196 else: |
197 return None | 197 return None |
198 | 198 |
199 | 199 |
200 class TestPackageGroupStop(unittest.TestCase, FileTestMixin): | 200 class TestPackageGroupStop(unittest.TestCase, FileTestMixin): |
250 # Note: The revisions in the pkg dir are not ordered so that we | 250 # Note: The revisions in the pkg dir are not ordered so that we |
251 # can check whether get_revision_numbers returns a sorted list | 251 # can check whether get_revision_numbers returns a sorted list |
252 # of revisions | 252 # of revisions |
253 trackdir = self.create_files("track", | 253 trackdir = self.create_files("track", |
254 [("pkg", | 254 [("pkg", |
255 [("704195-1", | 255 [("704195-0", |
256 [("status", ""), | 256 [("status", ""), |
257 ("src", []), | 257 ("src", []), |
258 ("binary", [])]), | 258 ("binary", [])]), |
259 ("702432-1", | 259 ("702432-2", |
260 [("status", ""), | 260 [("status", ""), |
261 ("src", []), | 261 ("src", []), |
262 ("binary", [])])])]) | 262 ("binary", [])])])]) |
263 track = PackageTrack("testtrack", trackdir, "", "", "", "", "") | 263 track = PackageTrack("testtrack", trackdir, "", "", "", "", "") |
264 self.assertEquals(track.get_revision_numbers(), [702432, 704195]) | 264 self.assertEquals(track.get_revision_numbers(), |
265 [(702432, 2), (704195, 0)]) | |
265 | 266 |
266 | 267 |
267 class TestRevisionPackager(unittest.TestCase, FileTestMixin): | 268 class TestRevisionPackager(unittest.TestCase, FileTestMixin): |
268 | 269 |
269 def test_list_source_files(self): | 270 def test_list_source_files(self): |
270 trackdir = self.create_files("track", | 271 trackdir = self.create_files("track", |
271 [("pkg", | 272 [("pkg", |
272 [("704195-1", | 273 [("704195-31", |
273 [("status", | 274 [("status", |
274 ("TreePackagerStatus 0.0\n" | 275 ("TreePackagerStatus 0.0\n" |
275 "status: binary_package_created\n" | 276 "status: binary_package_created\n" |
276 "start: 2007-09-10 17:16:48\n" | 277 "start: 2007-09-10 17:16:48\n" |
277 "stop: 2007-09-11 00:07:36\n")), | 278 "stop: 2007-09-11 00:07:36\n")), |
282 ("702432-1", | 283 ("702432-1", |
283 [("status", ""), | 284 [("status", ""), |
284 ("src", []), | 285 ("src", []), |
285 ("binary", [])])])]) | 286 ("binary", [])])])]) |
286 track = PackageTrack("testtrack", trackdir, "", "", "", "", "") | 287 track = PackageTrack("testtrack", trackdir, "", "", "", "", "") |
287 revpkg = RevisionPackager(track, 704195) | 288 revpkg = RevisionPackager(track, 704195, 31) |
288 srcdir = os.path.join(trackdir, "pkg", "704195-1", "src") | 289 srcdir = os.path.join(trackdir, "pkg", "704195-31", "src") |
289 self.assertEquals(revpkg.list_source_files(), | 290 self.assertEquals(revpkg.list_source_files(), |
290 [os.path.join(srcdir, filename) | 291 [os.path.join(srcdir, filename) |
291 for filename in ["test_1.0-1.diff.gz", | 292 for filename in ["test_1.0-1.diff.gz", |
292 "test_1.0-1.dsc", | 293 "test_1.0-1.dsc", |
293 "test_1.0.orig.tar.gz"]]) | 294 "test_1.0.orig.tar.gz"]]) |
308 ("702432-1", | 309 ("702432-1", |
309 [("status", ""), | 310 [("status", ""), |
310 ("src", []), | 311 ("src", []), |
311 ("binary", [])])])]) | 312 ("binary", [])])])]) |
312 track = PackageTrack("testtrack", trackdir, "", "", "", "", "") | 313 track = PackageTrack("testtrack", trackdir, "", "", "", "", "") |
313 revpkg = RevisionPackager(track, 704195) | 314 revpkg = RevisionPackager(track, 704195, 1) |
314 bindir = os.path.join(trackdir, "pkg", "704195-1", "binary") | 315 bindir = os.path.join(trackdir, "pkg", "704195-1", "binary") |
315 self.assertEquals(revpkg.list_binary_files(), | 316 self.assertEquals(revpkg.list_binary_files(), |
316 [os.path.join(bindir, filename) | 317 [os.path.join(bindir, filename) |
317 for filename in ["test_1.0-1_i386.changes", | 318 for filename in ["test_1.0-1_i386.changes", |
318 "test_1.0-1_i386.deb"]]) | 319 "test_1.0-1_i386.deb"]]) |