[Treepkg-commits] r19 - trunk/test
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon Nov 26 15:15:53 CET 2007
Author: bh
Date: 2007-11-26 15:15:52 +0100 (Mon, 26 Nov 2007)
New Revision: 19
Modified:
trunk/test/test_packager.py
Log:
refactor the packager test cases to prepare for more tests
Modified: trunk/test/test_packager.py
===================================================================
--- trunk/test/test_packager.py 2007-11-07 10:13:24 UTC (rev 18)
+++ trunk/test/test_packager.py 2007-11-26 14:15:52 UTC (rev 19)
@@ -70,11 +70,9 @@
revision_packager_cls = RevisionPackager
-class TestPackager(unittest.TestCase, FileTestMixin):
+class PackagerTest(unittest.TestCase, FileTestMixin):
- initial_files = [
- ("README", "and miles to go before I sleep"),
- ]
+ revisions = []
debian_files = [
("debian",
@@ -99,22 +97,29 @@
"""),
("rules", "binary: echo binary")])]
+
def setUp(self):
self.svndir = self.create_temp_dir(self.id() + "-svn")
self.svnworkdir = self.create_temp_dir(self.id() + "-svnwork")
self.trackdir = self.create_temp_dir(self.id() + "-track")
self.create_files(self.trackdir, self.debian_files)
+ self.svn_url = create_svn_repository(self.svndir) + "/trunk"
+ subversion.checkout(self.svn_url, self.svnworkdir)
+ add_svn_files(self.svnworkdir, self.revisions[0],
+ "Initial version")
+
+class TestPackager(PackagerTest):
+
+ revisions = [
+ [("README", "and miles to go before I sleep")],
+ ]
+
def runtest(self, debrevision, **extra_track_args):
- baseurl = create_svn_repository(self.svndir)
- svn_url = baseurl + "/trunk"
- subversion.checkout(svn_url, self.svnworkdir)
- add_svn_files(self.svnworkdir, self.initial_files,
- "Initial version")
rootcmd = os.path.join(os.path.dirname(__file__), os.pardir, "test",
"mocksudopbuilder.py")
track = PackageTrack(name="testpkg", base_dir=self.trackdir,
- svn_url=svn_url, pbuilderrc="",
+ svn_url=self.svn_url, pbuilderrc="",
root_cmd=[sys.executable, rootcmd],
deb_email="treepkg at example.com",
deb_fullname="treepkg tester",
More information about the Treepkg-commits
mailing list