comparison test/test_builder.py @ 183:72e41b27f224

Add test case for the save_after_exec parameter and adapt the other PBuilder.run_script tests to a change introduced in the last commit.
author Bernhard Herzog <bh@intevation.de>
date Wed, 25 Jun 2008 15:14:27 +0000
parents 81585486281b
children e1c7cd896310
comparison
equal deleted inserted replaced
182:88c8f255b5a0 183:72e41b27f224
242 def test_run_script(self): 242 def test_run_script(self):
243 builder = PBuilder("my_pbuilderrc", self.root_command) 243 builder = PBuilder("my_pbuilderrc", self.root_command)
244 builder.run_script(["my_script"], logfile="the_logfile") 244 builder.run_script(["my_script"], logfile="the_logfile")
245 self.check_command_line(['/usr/sbin/pbuilder', 'execute', 245 self.check_command_line(['/usr/sbin/pbuilder', 'execute',
246 '--configfile', 'my_pbuilderrc', 246 '--configfile', 'my_pbuilderrc',
247 '--logfile', 'the_logfile', 247 '--logfile', 'the_logfile', '--',
248 'my_script']) 248 'my_script'])
249 249
250 def test_run_script_with_arguments(self): 250 def test_run_script_with_arguments(self):
251 builder = PBuilder("my_pbuilderrc", self.root_command) 251 builder = PBuilder("my_pbuilderrc", self.root_command)
252 builder.run_script(["my_script", "--verbose"], logfile="the_logfile") 252 builder.run_script(["my_script", "--verbose"], logfile="the_logfile")
253 self.check_command_line(['/usr/sbin/pbuilder', 'execute', 253 self.check_command_line(['/usr/sbin/pbuilder', 'execute',
254 '--configfile', 'my_pbuilderrc', 254 '--configfile', 'my_pbuilderrc',
255 '--logfile', 'the_logfile', 255 '--logfile', 'the_logfile', '--',
256 'my_script', '--verbose']) 256 'my_script', '--verbose'])
257 257
258 def test_run_script_with_bindmounts(self): 258 def test_run_script_with_bindmounts(self):
259 builder = PBuilder("my_pbuilderrc", self.root_command) 259 builder = PBuilder("my_pbuilderrc", self.root_command)
260 builder.run_script(["my_script"], logfile="the_logfile", 260 builder.run_script(["my_script"], logfile="the_logfile",
263 self.check_command_line(['/usr/sbin/pbuilder', 'execute', 263 self.check_command_line(['/usr/sbin/pbuilder', 'execute',
264 '--configfile', 'my_pbuilderrc', 264 '--configfile', 'my_pbuilderrc',
265 '--logfile', 'the_logfile', 265 '--logfile', 'the_logfile',
266 '--bindmounts', '/home/builder/foo', 266 '--bindmounts', '/home/builder/foo',
267 '--bindmounts', '/home/builder/treepkg', 267 '--bindmounts', '/home/builder/treepkg',
268 'my_script']) 268 '--', 'my_script'])
269
270 def test_run_script_save_after_exec(self):
271 builder = PBuilder("my_pbuilderrc", self.root_command)
272 builder.run_script(["my_script", "--verbose"], logfile="the_logfile",
273 save_after_exec=True)
274 self.check_command_line(['/usr/sbin/pbuilder', 'execute',
275 '--configfile', 'my_pbuilderrc',
276 '--logfile', 'the_logfile',
277 '--save-after-exec', '--',
278 'my_script', '--verbose'])
269 279
270 280
271 class TestPBuilderWithBinaryPackage(PBuilderTests): 281 class TestPBuilderWithBinaryPackage(PBuilderTests):
272 282
273 minimal_package = [ 283 minimal_package = [
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)