summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSachi King <nakato@nakato.io>2016-05-10 13:16:44 +1000
committerSachi King <nakato@nakato.io>2016-05-10 13:16:44 +1000
commitfc73a70a79ec5f5ce8bdba70dd73bd61555ea277 (patch)
tree15af795f6f20f0af0222b0d1695d57917b1866b1
parentab4346fba2a7f92f0a742df624c32ea3ff9767fd (diff)
downloadtox-fc73a70a79ec5f5ce8bdba70dd73bd61555ea277.tar.gz
Add test for issue #307
This adds a test to address the second example in issue #307, the first example is already addressed. Closes issue #307
-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 372cd4f..471e784 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -288,6 +288,20 @@ class TestIniParserAgainstCommandsKey:
x = reader.getargvlist("commands")
assert x == [['thing', 'argpos', 'arg2']]
+ def test_command_section_and_posargs_substitution(self, newconfig):
+ """Ensure subsitition from other section with posargs succeeds"""
+ config = newconfig("""
+ [section]
+ key = thing arg1
+ [testenv]
+ commands =
+ {[section]key} {posargs} endarg
+ """)
+ reader = SectionReader("testenv", config._cfg)
+ reader.addsubstitutions([r"argpos"])
+ x = reader.getargvlist("commands")
+ assert x == [['thing', 'arg1', 'argpos', 'endarg']]
+
def test_command_env_substitution(self, newconfig):
"""Ensure referenced {env:key:default} values are substituted correctly."""
config = newconfig("""