comparison test/test_builder.py @ 181:81585486281b

Extend the PBuilder.run_script method so that the script can be called with arguments
author Bernhard Herzog <bh@intevation.de>
date Wed, 25 Jun 2008 13:36:38 +0000
parents b2fa3b0926d0
children 72e41b27f224
comparison
equal deleted inserted replaced
180:12e4efd5cc74 181:81585486281b
239 self.failUnless(os.path.isdir(binary_dir_name)) 239 self.failUnless(os.path.isdir(binary_dir_name))
240 self.failUnless(os.path.exists(env_test_file)) 240 self.failUnless(os.path.exists(env_test_file))
241 241
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):
251 builder = PBuilder("my_pbuilderrc", self.root_command)
252 builder.run_script(["my_script", "--verbose"], logfile="the_logfile")
253 self.check_command_line(['/usr/sbin/pbuilder', 'execute',
254 '--configfile', 'my_pbuilderrc',
255 '--logfile', 'the_logfile',
256 'my_script', '--verbose'])
257
250 def test_run_script_with_bindmounts(self): 258 def test_run_script_with_bindmounts(self):
251 builder = PBuilder("my_pbuilderrc", self.root_command) 259 builder = PBuilder("my_pbuilderrc", self.root_command)
252 builder.run_script("my_script", logfile="the_logfile", 260 builder.run_script(["my_script"], logfile="the_logfile",
253 bindmounts=("/home/builder/foo", 261 bindmounts=("/home/builder/foo",
254 "/home/builder/treepkg")) 262 "/home/builder/treepkg"))
255 self.check_command_line(['/usr/sbin/pbuilder', 'execute', 263 self.check_command_line(['/usr/sbin/pbuilder', 'execute',
256 '--configfile', 'my_pbuilderrc', 264 '--configfile', 'my_pbuilderrc',
257 '--logfile', 'the_logfile', 265 '--logfile', 'the_logfile',
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)