2 new revisions:

Revision: e54323e1bc2d
Branch:   default
Author:   Mika Hänninen <[email protected]>
Date:     Wed May 15 01:25:09 2013
Log:      process lib: added couple more tests for env argument
http://code.google.com/p/robotframework/source/detail?r=e54323e1bc2d

Revision: d1483863f594
Branch:   default
Author:   Mika Hänninen <[email protected]>
Date:     Wed May 15 01:41:15 2013
Log:      process lib: more generic handling of additional arguments
http://code.google.com/p/robotframework/source/detail?r=d1483863f594

==============================================================================
Revision: e54323e1bc2d
Branch:   default
Author:   Mika Hänninen <[email protected]>
Date:     Wed May 15 01:25:09 2013
Log:      process lib: added couple more tests for env argument
http://code.google.com/p/robotframework/source/detail?r=e54323e1bc2d

Modified:
 /atest/robot/standard_libraries/process/test_process_library.txt
 /atest/testdata/standard_libraries/process/test_process_library.txt

=======================================
--- /atest/robot/standard_libraries/process/test_process_library.txt Tue May 14 06:14:58 2013 +++ /atest/robot/standard_libraries/process/test_process_library.txt Wed May 15 01:25:09 2013
@@ -32,6 +32,12 @@
 Setting Environment
     Check Test Case    ${TESTNAME}

+Setting Environment With Multiple Values
+    Check Test Case    ${TESTNAME}
+
+Setting Environment With Multiple Values Using Dictionary
+    Check Test Case    ${TESTNAME}
+
 Escaping equals sign
     Check Test Case    ${TESTNAME}

=======================================
--- /atest/testdata/standard_libraries/process/test_process_library.txt Wed May 15 01:17:25 2013 +++ /atest/testdata/standard_libraries/process/test_process_library.txt Wed May 15 01:25:09 2013
@@ -58,7 +58,7 @@

 Setting Environment
     @{curenv}=    Get Environment Variables
-    ${setenv}=    Create Dictionary           special_var    spessu
+    ${setenv}=    Create Dictionary           special_var  spessu
${result}= Run Process python -c "import os; print os.environ;" shell=True
     Should Match        ${result.stdout}   *@{curenv}[0]*
     Should Not Match    ${result.stdout}   *special_var*
@@ -69,6 +69,21 @@
     Should Not Match    ${result.stdout}   *@{curenv}[0]*
     Should Match        ${result.stdout}   *special_var*

+Setting Environment With Multiple Values
+    @{curenv}=    Get Environment Variables
+ ${result}= Run Process python -c "import os; print os.environ;" shell=True env:special_var=spessu env:diiba=daaba
+    Should Not Match    ${result.stdout}   *@{curenv}[0]*
+    Should Match        ${result.stdout}   *special_var*
+    Should Match        ${result.stdout}   *diiba*
+
+Setting Environment With Multiple Values Using Dictionary
+    @{curenv}=    Get Environment Variables
+ ${setenv}= Create Dictionary special_var spessu diiba2 daaba2 + ${result}= Run Process python -c "import os; print os.environ;" shell=True env=${setenv}
+    Should Not Match    ${result.stdout}   *@{curenv}[0]*
+    Should Match        ${result.stdout}   *special_var*
+    Should Match        ${result.stdout}   *diiba2*
+
 Escaping equals sign
${result}= Run Process python -c print 'stderr\=bar.buu' shell=True
     Result should equal    ${result}    stdout=*stderr=bar.buu*

==============================================================================
Revision: d1483863f594
Branch:   default
Author:   Mika Hänninen <[email protected]>
Date:     Wed May 15 01:41:15 2013
Log:      process lib: more generic handling of additional arguments
http://code.google.com/p/robotframework/source/detail?r=d1483863f594

Modified:
 /src/robot/libraries/Process.py

=======================================
--- /src/robot/libraries/Process.py     Tue May 14 06:14:58 2013
+++ /src/robot/libraries/Process.py     Wed May 15 01:41:15 2013
@@ -392,7 +392,8 @@
         self.stderr_stream = self._get_stderr(stderr, stdout)
         self.shell = bool(shell)
         self.alias = alias
-        self.env = self._set_environment(rest)
+        self.env = None
+        self._handle_rest(rest)

     def _new_stream(self, name, postfix):
         if name:
@@ -410,14 +411,16 @@
         ProcessConfig.FILE_INDEX += 1
         return open(os.path.join(self._tempdir, filename), 'w')

-    def _set_environment(self, env):
-        if not env:
-            return None
+    def _handle_rest(self, rest):
+        if not rest:
+            return
         new_env = dict()
-        for key,val in env.iteritems():
+        for key,val in rest.iteritems():
             if key == "env":
-                return val
-            elif "env:" not in key[:4]:
+                self.env = val
+            elif "env:" in key[:4]:
+                new_env[key[4:]] = val
+            else:
raise UnrecognizedParameterError("'%s' is not supported by this keyword." % key )
-            new_env[key[4:]] = val
-        return new_env
+        if not self.env:
+            self.env = new_env

--

--- You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to