summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrisztian Fekete <fkr972@gmail.com>2013-04-27 01:03:59 +0200
committerKrisztian Fekete <fkr972@gmail.com>2013-04-27 01:03:59 +0200
commit3f2ae4be6263f916a5edf288faae71dd61ff0c24 (patch)
treeb1fa929a5ae299a2531aeaa698c42f532bffdaeb
parent848faf305087f021bb8efc57a1a626d554bfa449 (diff)
downloadtox-3f2ae4be6263f916a5edf288faae71dd61ff0c24.tar.gz
Tests for issue #97 {[section]name} substitution does not work in general
-rw-r--r--tests/test_config.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_config.py b/tests/test_config.py
index 264710b..e529236 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -176,6 +176,29 @@ class TestIniParser:
py.test.raises(tox.exception.ConfigError,
'reader.getdefault("section", "key2")')
+ def test_getdefault_other_section_substitution(self, newconfig):
+ config = newconfig("""
+ [section]
+ key = rue
+ [testenv]
+ key = t{[section]key}
+ """)
+ reader = IniReader(config._cfg)
+ x = reader.getdefault("testenv", "key")
+ assert x == "true"
+
+ def test_command_substitution_from_other_section(self, newconfig):
+ config = newconfig("""
+ [section]
+ key = whatever
+ [testenv]
+ commands =
+ echo {[section]key}
+ """)
+ reader = IniReader(config._cfg)
+ x = reader.getargvlist("testenv", "commands")
+ assert x == [["echo", "whatever"]]
+
def test_argvlist(self, tmpdir, newconfig):
config = newconfig("""
[section]