Mercurial > treepkg
comparison test/test_packager.py @ 334:4c047e979ff4
Updated tests to reflect that Subversion revisions are now handled
as strings.
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Thu, 08 Apr 2010 10:17:45 +0000 |
parents | 24db9223488b |
children | f06f707d9fda |
comparison
equal
deleted
inserted
replaced
333:cbf372f07daa | 334:4c047e979ff4 |
---|---|
49 origtargz = os.path.join(self.work_dir, | 49 origtargz = os.path.join(self.work_dir, |
50 pkgbasename + ".orig.tar.gz") | 50 pkgbasename + ".orig.tar.gz") |
51 self.create_tarball(origtargz, self.work_dir, | 51 self.create_tarball(origtargz, self.work_dir, |
52 os.path.basename(pkgbasedir)) | 52 os.path.basename(pkgbasedir)) |
53 | 53 |
54 changemsg = ("Update to SVN rev. %d" % (self.revision,)) | 54 changemsg = ("Update to SVN rev. %s" % (self.revision,)) |
55 self.copy_debian_directory(pkgbasedir, pkgbaseversion, | 55 self.copy_debian_directory(pkgbasedir, pkgbaseversion, |
56 changemsg) | 56 changemsg) |
57 | 57 |
58 self.create_source_package(pkgbasedir, origtargz) | 58 self.create_source_package(pkgbasedir, origtargz) |
59 self.move_source_package(pkgbasename) | 59 self.move_source_package(pkgbasename) |
126 # check_package_tracks will leave the checkout in the revision | 126 # check_package_tracks will leave the checkout in the revision |
127 # that was actually packaged. | 127 # that was actually packaged. |
128 version = track.last_changed_revision() | 128 version = track.last_changed_revision() |
129 | 129 |
130 # Now check the source and binary package files | 130 # Now check the source and binary package files |
131 pkgdir = os.path.join(self.trackdir, "pkg", "%d-0" % version) | 131 pkgdir = os.path.join(self.trackdir, "pkg", "%s-0" % version) |
132 self.assertEquals(sorted(os.listdir(os.path.join(pkgdir, "src"))), | 132 self.assertEquals(sorted(os.listdir(os.path.join(pkgdir, "src"))), |
133 [name % locals() for name in | 133 [name % locals() for name in |
134 ["testpkg_%(version)d-%(debrevision)s.diff.gz", | 134 ["testpkg_%(version)s-%(debrevision)s.diff.gz", |
135 "testpkg_%(version)d-%(debrevision)s.dsc", | 135 "testpkg_%(version)s-%(debrevision)s.dsc", |
136 "testpkg_%(version)d.orig.tar.gz"]]) | 136 "testpkg_%(version)s.orig.tar.gz"]]) |
137 self.assertEquals(sorted(os.listdir(os.path.join(pkgdir, "binary"))), | 137 self.assertEquals(sorted(os.listdir(os.path.join(pkgdir, "binary"))), |
138 [name % locals() for name in | 138 [name % locals() for name in |
139 ["testpkg_%(version)d-%(debrevision)s_all.deb", | 139 ["testpkg_%(version)s-%(debrevision)s_all.deb", |
140 "testpkg_%(version)d-%(debrevision)s_i386.changes"]]) | 140 "testpkg_%(version)s-%(debrevision)s_i386.changes"]]) |
141 | 141 |
142 | 142 |
143 class TestPackager(PackagerTest): | 143 class TestPackager(PackagerTest): |
144 | 144 |
145 revisions = [ | 145 revisions = [ |
149 | 149 |
150 def test_default_pkg_revision_template(self): | 150 def test_default_pkg_revision_template(self): |
151 self.runtest("treepkg1") | 151 self.runtest("treepkg1") |
152 | 152 |
153 def test_custom_pkg_revision_template(self): | 153 def test_custom_pkg_revision_template(self): |
154 self.runtest("kk1.2", pkg_revision_template="kk%(pkg_revision)d.2") | 154 self.runtest("kk1.2", pkg_revision_template="kk%(pkg_revision)s.2") |
155 | 155 |
156 | 156 |
157 class TestPackagerWithMultipleRevisions(PackagerTest): | 157 class TestPackagerWithMultipleRevisions(PackagerTest): |
158 | 158 |
159 revisions = [ | 159 revisions = [ |
166 ] | 166 ] |
167 | 167 |
168 def test_packaging_specific_revision(self): | 168 def test_packaging_specific_revision(self): |
169 # Package the newest revision and then package an older one. | 169 # Package the newest revision and then package an older one. |
170 self.runtest("treepkg1") | 170 self.runtest("treepkg1") |
171 self.runtest("treepkg1", group_args=dict(revision=3)) | 171 self.runtest("treepkg1", group_args=dict(revision='3')) |
172 | 172 |
173 | 173 |
174 class StoppingPackager(treepkg.packager.RevisionPackager): | 174 class StoppingPackager(treepkg.packager.RevisionPackager): |
175 | 175 |
176 def package(self): | 176 def package(self): |