Commits

Marc Abramowitz  committed b1e0902

Add test_posargs_backslashed_or_quoted

  • Participants
  • Parent commits 9d7345e
  • Branches allow_backslash_escape_curly_braces_msabramo_2

Comments (0)

Files changed (1)

File tests/test_config.py

         assert argv[0] == ["cmd1", "[hello]", "world"]
         assert argv[1] == ["cmd1", "brave", "new", "world"]
 
+    def test_posargs_backslashed_or_quoted(self, tmpdir, newconfig):
+        inisource = """
+            [testenv:py24]
+            commands =
+                echo "\{posargs\}" = {posargs}
+                echo "posargs = " "{posargs}"
+        """
+        conf = newconfig([], inisource).envconfigs['py24']
+        argv = conf.commands
+        assert argv[0] == ['echo', '\\{posargs\\}', '=']
+        assert argv[1] == ['echo', 'posargs =']
+
+        conf = newconfig(['dog', 'cat'], inisource).envconfigs['py24']
+        argv = conf.commands
+        assert argv[0] == ['echo', '\\{posargs\\}', '=', 'dog', 'cat']
+        assert argv[1] == ['echo', 'posargs =', 'dog', 'cat']
+
     def test_rewrite_posargs(self, tmpdir, newconfig):
         inisource = """
             [testenv:py24]