summaryrefslogtreecommitdiff
path: root/setuptools/tests/test_easy_install.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-01-04 22:11:08 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-01-04 22:11:08 -0500
commit6ab7d6dbb13e0ef1f44bf0461f3ffdb06f07b3b2 (patch)
treebc152731f258fe61663ab5785f71bb9a908b74d7 /setuptools/tests/test_easy_install.py
parentab6887a55394c77982212c058c59addeb77736f7 (diff)
downloadpython-setuptools-git-6ab7d6dbb13e0ef1f44bf0461f3ffdb06f07b3b2.tar.gz
Add test demonstrating how a custom launch command spec that could be passed as the script executable.
Diffstat (limited to 'setuptools/tests/test_easy_install.py')
-rw-r--r--setuptools/tests/test_easy_install.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py
index 86870866..3a8ddbfb 100644
--- a/setuptools/tests/test_easy_install.py
+++ b/setuptools/tests/test_easy_install.py
@@ -23,7 +23,7 @@ from setuptools.compat import StringIO, BytesIO, urlparse
from setuptools.sandbox import run_setup
from setuptools.command.easy_install import (
easy_install, fix_jython_executable, nt_quote_arg,
- is_sh, ScriptWriter,
+ is_sh, ScriptWriter, CommandSpec,
)
from setuptools.command.easy_install import PthDistributions
from setuptools.command import easy_install as easy_install_pkg
@@ -481,3 +481,21 @@ class TestScriptHeader:
assert candidate == '#!%s -x\n' % self.non_ascii_exe
output = locals()[expect_out]
assert 'Unable to adapt shebang line' in output.getvalue()
+
+
+class TestCommandSpec:
+ def test_custom_launch_command(self):
+ """
+ Show how a custom CommandSpec could be used to specify a #! executable
+ which takes parameters.
+ """
+ cmd = CommandSpec(['/usr/bin/env', 'python3'])
+ assert cmd.as_header() == '#!/usr/bin/env python3\n'
+
+ def test_from_param_for_CommandSpec_is_passthrough(self):
+ """
+ from_param should return an instance of a CommandSpec
+ """
+ cmd = CommandSpec(['python'])
+ cmd_new = CommandSpec.from_param(cmd)
+ assert cmd is cmd_new