From 833a0692079aa18ee781403d3ab94122a1ef8fe1 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Sun, 5 Jul 2020 17:39:40 +0100 Subject: [PATCH] Pass PATH during command substitution test --- unit_test/environment_test.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/unit_test/environment_test.py b/unit_test/environment_test.py index 850233e3..4e10e07c 100644 --- a/unit_test/environment_test.py +++ b/unit_test/environment_test.py @@ -97,8 +97,9 @@ def test_no_vars_pass_through(): def test_operators_inside_eval(): - environment_recipe = parse_environment('SOMETHING="$(echo a ; echo b ; echo c)"') + environment_recipe = parse_environment('SOMETHING="$(echo a; echo b; echo c)"') - environment_dict = environment_recipe.as_dictionary({}) + # pass the existing process env so PATH is available + environment_dict = environment_recipe.as_dictionary(os.environ.copy()) - assert environment_dict == {'SOMETHING': 'a\nb\nc'} + assert environment_dict.get('SOMETHING') == 'a\nb\nc'