changeset 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 88c8f255b5a0
children 83c77307ffb1
files test/test_builder.py
diffstat 1 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/test/test_builder.py	Wed Jun 25 15:09:06 2008 +0000
+++ b/test/test_builder.py	Wed Jun 25 15:14:27 2008 +0000
@@ -244,7 +244,7 @@
         builder.run_script(["my_script"], logfile="the_logfile")
         self.check_command_line(['/usr/sbin/pbuilder', 'execute',
                                  '--configfile', 'my_pbuilderrc',
-                                 '--logfile', 'the_logfile',
+                                 '--logfile', 'the_logfile', '--',
                                  'my_script'])
 
     def test_run_script_with_arguments(self):
@@ -252,7 +252,7 @@
         builder.run_script(["my_script", "--verbose"], logfile="the_logfile")
         self.check_command_line(['/usr/sbin/pbuilder', 'execute',
                                  '--configfile', 'my_pbuilderrc',
-                                 '--logfile', 'the_logfile',
+                                 '--logfile', 'the_logfile', '--',
                                  'my_script', '--verbose'])
 
     def test_run_script_with_bindmounts(self):
@@ -265,7 +265,17 @@
                                  '--logfile', 'the_logfile',
                                  '--bindmounts', '/home/builder/foo',
                                  '--bindmounts', '/home/builder/treepkg',
-                                 'my_script'])
+                                 '--', 'my_script'])
+
+    def test_run_script_save_after_exec(self):
+        builder = PBuilder("my_pbuilderrc", self.root_command)
+        builder.run_script(["my_script", "--verbose"], logfile="the_logfile",
+                           save_after_exec=True)
+        self.check_command_line(['/usr/sbin/pbuilder', 'execute',
+                                 '--configfile', 'my_pbuilderrc',
+                                 '--logfile', 'the_logfile',
+                                 '--save-after-exec', '--',
+                                 'my_script', '--verbose'])
 
 
 class TestPBuilderWithBinaryPackage(PBuilderTests):
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)