diff test/test_packager.py @ 93:73c67372c7f7

Make the prefix used in the debian revision number configurable. This involves a new config file setting documented in demo.cfg, the necessary changes to the packagers and updated and new test cases
author Bernhard Herzog <bh@intevation.de>
date Wed, 07 Nov 2007 10:13:24 +0000
parents 3ed079a7174a
children 0c13a84a67dd
line wrap: on
line diff
--- a/test/test_packager.py	Tue Nov 06 17:30:11 2007 +0000
+++ b/test/test_packager.py	Wed Nov 07 10:13:24 2007 +0000
@@ -105,7 +105,7 @@
         self.trackdir = self.create_temp_dir(self.id() + "-track")
         self.create_files(self.trackdir, self.debian_files)
 
-    def test(self):
+    def runtest(self, debrevision, **extra_track_args):
         baseurl = create_svn_repository(self.svndir)
         svn_url = baseurl + "/trunk"
         subversion.checkout(svn_url, self.svnworkdir)
@@ -117,19 +117,26 @@
                              svn_url=svn_url, pbuilderrc="",
                              root_cmd=[sys.executable, rootcmd],
                              deb_email="treepkg@example.com",
-                             deb_fullname="treepkg tester")
+                             deb_fullname="treepkg tester",
+                             **extra_track_args)
         group = PackagerGroup([track], 1)
         group.check_package_tracks()
 
         # Now check the source and binary package files
         pkgdir = os.path.join(self.trackdir, "pkg", "2-1")
         self.assertEquals(sorted(os.listdir(os.path.join(pkgdir, "src"))),
-                          ["testpkg_2-kk1.diff.gz",
-                           "testpkg_2-kk1.dsc",
+                          ["testpkg_2-%s.diff.gz" % debrevision,
+                           "testpkg_2-%s.dsc" % debrevision,
                            "testpkg_2.orig.tar.gz"])
         self.assertEquals(sorted(os.listdir(os.path.join(pkgdir, "binary"))),
-                          ["testpkg_2-kk1_all.deb",
-                           "testpkg_2-kk1_i386.changes"])
+                          ["testpkg_2-%s_all.deb" % debrevision,
+                           "testpkg_2-%s_i386.changes" % debrevision])
+
+    def test_default_debrevision_prefix(self):
+        self.runtest("treepkg1")
+
+    def test_custom_debrevision_prefix(self):
+        self.runtest("kk1", debrevision_prefix="kk")
 
 class StoppingPackager(treepkg.packager.RevisionPackager):
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)