Mercurial > treepkg
comparison test/test_packager.py @ 97:d85efd3276bd
revert previous change; it was committed accidentally
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Mon, 26 Nov 2007 14:45:19 +0000 |
parents | efbd66b13f51 |
children | f7b9c7113c46 |
comparison
equal
deleted
inserted
replaced
96:efbd66b13f51 | 97:d85efd3276bd |
---|---|
106 self.svn_url = create_svn_repository(self.svndir) + "/trunk" | 106 self.svn_url = create_svn_repository(self.svndir) + "/trunk" |
107 subversion.checkout(self.svn_url, self.svnworkdir) | 107 subversion.checkout(self.svn_url, self.svnworkdir) |
108 for message, files in self.revisions: | 108 for message, files in self.revisions: |
109 add_svn_files(self.svnworkdir, files, message) | 109 add_svn_files(self.svnworkdir, files, message) |
110 | 110 |
111 def runtest(self, debrevision, group_args=None, **extra_track_args): | 111 def runtest(self, debrevision, **extra_track_args): |
112 rootcmd = os.path.join(os.path.dirname(__file__), os.pardir, "test", | 112 rootcmd = os.path.join(os.path.dirname(__file__), os.pardir, "test", |
113 "mocksudopbuilder.py") | 113 "mocksudopbuilder.py") |
114 track = PackageTrack(name="testpkg", base_dir=self.trackdir, | 114 track = PackageTrack(name="testpkg", base_dir=self.trackdir, |
115 svn_url=self.svn_url, pbuilderrc="", | 115 svn_url=self.svn_url, pbuilderrc="", |
116 root_cmd=[sys.executable, rootcmd], | 116 root_cmd=[sys.executable, rootcmd], |
117 deb_email="treepkg@example.com", | 117 deb_email="treepkg@example.com", |
118 deb_fullname="treepkg tester", | 118 deb_fullname="treepkg tester", |
119 **extra_track_args) | 119 **extra_track_args) |
120 | 120 group = PackagerGroup([track], 1) |
121 if group_args is None: | |
122 group_args = {} | |
123 group = PackagerGroup([track], 1, **group_args) | |
124 group.check_package_tracks() | 121 group.check_package_tracks() |
125 | 122 |
126 # determine version that has been packaged. This assumes that | 123 # determine version that has been packaged. This assumes that |
127 # check_package_tracks will leave the checkout in the revision | 124 # check_package_tracks will leave the checkout in the revision |
128 # that was actually packaged. | 125 # that was actually packaged. |
151 def test_default_debrevision_prefix(self): | 148 def test_default_debrevision_prefix(self): |
152 self.runtest("treepkg1") | 149 self.runtest("treepkg1") |
153 | 150 |
154 def test_custom_debrevision_prefix(self): | 151 def test_custom_debrevision_prefix(self): |
155 self.runtest("kk1", debrevision_prefix="kk") | 152 self.runtest("kk1", debrevision_prefix="kk") |
156 | |
157 | |
158 class TestPackerWithMultipleRevisions(PackagerTest): | |
159 | |
160 revisions = [ | |
161 ("Initial Revision", | |
162 [("README", "and miles to go before I sleep")]), | |
163 ("Add some code", | |
164 [("program.c", "int main(void) { return 0; }")]), | |
165 ("Add some more code", | |
166 [("another.c", "int main(void) { return 1; }")]), | |
167 ] | |
168 | |
169 def test_default_debrevision_prefix(self): | |
170 self.runtest("treepkg1") | |
171 self.runtest("treepkg1", group_args=dict(revision=3) | |
172 | |
173 | 153 |
174 class StoppingPackager(treepkg.packager.RevisionPackager): | 154 class StoppingPackager(treepkg.packager.RevisionPackager): |
175 | 155 |
176 def package(self): | 156 def package(self): |
177 pass | 157 pass |