comparison 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
comparison
equal deleted inserted replaced
92:1c74e3b56a63 93:73c67372c7f7
103 self.svndir = self.create_temp_dir(self.id() + "-svn") 103 self.svndir = self.create_temp_dir(self.id() + "-svn")
104 self.svnworkdir = self.create_temp_dir(self.id() + "-svnwork") 104 self.svnworkdir = self.create_temp_dir(self.id() + "-svnwork")
105 self.trackdir = self.create_temp_dir(self.id() + "-track") 105 self.trackdir = self.create_temp_dir(self.id() + "-track")
106 self.create_files(self.trackdir, self.debian_files) 106 self.create_files(self.trackdir, self.debian_files)
107 107
108 def test(self): 108 def runtest(self, debrevision, **extra_track_args):
109 baseurl = create_svn_repository(self.svndir) 109 baseurl = create_svn_repository(self.svndir)
110 svn_url = baseurl + "/trunk" 110 svn_url = baseurl + "/trunk"
111 subversion.checkout(svn_url, self.svnworkdir) 111 subversion.checkout(svn_url, self.svnworkdir)
112 add_svn_files(self.svnworkdir, self.initial_files, 112 add_svn_files(self.svnworkdir, self.initial_files,
113 "Initial version") 113 "Initial version")
115 "mocksudopbuilder.py") 115 "mocksudopbuilder.py")
116 track = PackageTrack(name="testpkg", base_dir=self.trackdir, 116 track = PackageTrack(name="testpkg", base_dir=self.trackdir,
117 svn_url=svn_url, pbuilderrc="", 117 svn_url=svn_url, pbuilderrc="",
118 root_cmd=[sys.executable, rootcmd], 118 root_cmd=[sys.executable, rootcmd],
119 deb_email="treepkg@example.com", 119 deb_email="treepkg@example.com",
120 deb_fullname="treepkg tester") 120 deb_fullname="treepkg tester",
121 **extra_track_args)
121 group = PackagerGroup([track], 1) 122 group = PackagerGroup([track], 1)
122 group.check_package_tracks() 123 group.check_package_tracks()
123 124
124 # Now check the source and binary package files 125 # Now check the source and binary package files
125 pkgdir = os.path.join(self.trackdir, "pkg", "2-1") 126 pkgdir = os.path.join(self.trackdir, "pkg", "2-1")
126 self.assertEquals(sorted(os.listdir(os.path.join(pkgdir, "src"))), 127 self.assertEquals(sorted(os.listdir(os.path.join(pkgdir, "src"))),
127 ["testpkg_2-kk1.diff.gz", 128 ["testpkg_2-%s.diff.gz" % debrevision,
128 "testpkg_2-kk1.dsc", 129 "testpkg_2-%s.dsc" % debrevision,
129 "testpkg_2.orig.tar.gz"]) 130 "testpkg_2.orig.tar.gz"])
130 self.assertEquals(sorted(os.listdir(os.path.join(pkgdir, "binary"))), 131 self.assertEquals(sorted(os.listdir(os.path.join(pkgdir, "binary"))),
131 ["testpkg_2-kk1_all.deb", 132 ["testpkg_2-%s_all.deb" % debrevision,
132 "testpkg_2-kk1_i386.changes"]) 133 "testpkg_2-%s_i386.changes" % debrevision])
134
135 def test_default_debrevision_prefix(self):
136 self.runtest("treepkg1")
137
138 def test_custom_debrevision_prefix(self):
139 self.runtest("kk1", debrevision_prefix="kk")
133 140
134 class StoppingPackager(treepkg.packager.RevisionPackager): 141 class StoppingPackager(treepkg.packager.RevisionPackager):
135 142
136 def package(self): 143 def package(self):
137 pass 144 pass
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)