aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-01-20 09:40:43 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-01-20 09:40:43 -0500
commitdc1b07f1dfc92e097be704ad19824194a95317d2 (patch)
tree58d0af23e1232bc0abba44614d2cfd8ed818d8e1
parentc808d232427ed8072b3b46b9e1c03df9d4cf9f76 (diff)
downloadexternal_python_setuptools-dc1b07f1dfc92e097be704ad19824194a95317d2.tar.gz
external_python_setuptools-dc1b07f1dfc92e097be704ad19824194a95317d2.tar.bz2
external_python_setuptools-dc1b07f1dfc92e097be704ad19824194a95317d2.zip
Add test capturing regression in script creation in WindowsScriptWriter.
-rw-r--r--setuptools/tests/test_easy_install.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py
index cbbe99db..a2f26e08 100644
--- a/setuptools/tests/test_easy_install.py
+++ b/setuptools/tests/test_easy_install.py
@@ -24,6 +24,7 @@ from setuptools import sandbox
from setuptools import compat
from setuptools.compat import StringIO, BytesIO, urlparse
from setuptools.sandbox import run_setup
+import setuptools.command.easy_install as ei
from setuptools.command.easy_install import (
easy_install, fix_jython_executable, nt_quote_arg,
is_sh, ScriptWriter, CommandSpec,
@@ -526,3 +527,14 @@ class TestCommandSpec:
cmd = writer.command_spec_class.from_string(sys.executable)
assert len(cmd) == 1
assert cmd[0] == sys.executable
+
+
+class TestWindowsScriptWriter:
+ def test_header(self):
+ hdr = ei.WindowsScriptWriter.get_script_header('')
+ assert hdr.startswith('#!')
+ assert hdr.endswith('\n')
+ hdr = hdr.lstrip('#!')
+ hdr = hdr.rstrip('\n')
+ # header should not start with an escaped quote
+ assert not hdr.startswith('\\"')