File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,25 @@ def test_execute_command(self):
5858 stdout = stdout .strip ()
5959 self .assertEqual (stdout , "Hello Rez World!" )
6060
61+ def test_execute_command_environ (self ):
62+ """Test that execute_command properly sets environ dict."""
63+ parent_environ = {"BIGLY" : "covfefe" }
64+ r = ResolvedContext (["hello_world" ])
65+
66+ pycode = ("import os; "
67+ "print os.getenv(\" BIGLY\" ); "
68+ "print os.getenv(\" OH_HAI_WORLD\" )" )
69+
70+ args = ["python" , "-c" , pycode ]
71+
72+ p = r .execute_command (args , parent_environ = parent_environ ,
73+ stdout = subprocess .PIPE )
74+ stdout , _ = p .communicate ()
75+ stdout = stdout .strip ()
76+ parts = [x .strip () for x in stdout .split ('\n ' )]
77+
78+ self .assertEqual (parts , ["covfefe" , "hello" ])
79+
6180 def test_serialize (self ):
6281 """Test save/load of context."""
6382 # save
You can’t perform that action at this time.
0 commit comments