changeset 94:0c13a84a67dd

refactor the packager test cases to prepare for more tests
author Bernhard Herzog <bh@intevation.de>
date Mon, 26 Nov 2007 14:15:52 +0000
parents 73c67372c7f7
children 8f1c72135ea6
files test/test_packager.py
diffstat 1 files changed, 15 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/test/test_packager.py	Wed Nov 07 10:13:24 2007 +0000
+++ b/test/test_packager.py	Mon Nov 26 14:15:52 2007 +0000
@@ -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@example.com",
                              deb_fullname="treepkg tester",
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)