summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSachi King <nakato@nakato.io>2016-02-11 13:46:02 +1100
committerSachi King <nakato@nakato.io>2016-02-11 13:46:02 +1100
commitb370f49189add61626f1aad5ed61eb9023daeb84 (patch)
treef499b17064888afecf4cd288450c94b11bb5d5d0
parentdeaacda2f7691916ff9fb703536b012d6d546208 (diff)
downloadtox-b370f49189add61626f1aad5ed61eb9023daeb84.tar.gz
Add test for subsitition from other section with posargs
Test command substitution from other section with {posargs} in use. Issue #279
-rw-r--r--tests/test_config.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_config.py b/tests/test_config.py
index 6176641..f669726 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -274,6 +274,20 @@ class TestIniParserAgainstCommandsKey:
["echo", "cmd", "1", "2", "3", "4", "cmd", "2"],
]
+ def test_command_substitution_from_other_section_posargs(self, newconfig):
+ """Ensure subsitition from other section with posargs succeeds"""
+ config = newconfig("""
+ [section]
+ key = thing {posargs} arg2
+ [testenv]
+ commands =
+ {[section]key}
+ """)
+ reader = SectionReader("testenv", config._cfg)
+ reader.addsubstitutions([r"argpos"])
+ x = reader.getargvlist("commands")
+ assert x == [['thing', 'argpos' 'arg2']]
+
def test_command_env_substitution(self, newconfig):
"""Ensure referenced {env:key:default} values are substituted correctly."""
config = newconfig("""