Commit 75501354 authored by Jason R. Coombs's avatar Jason R. Coombs

Pull logic out of the context

parent a1ef38f9
......@@ -451,14 +451,15 @@ class TestScriptHeader:
mock.Mock(getProperty=mock.Mock(return_value="")))))
@mock.patch('sys.platform', 'java1.5.0_13')
def test_get_script_header_jython_workaround(self):
# A mock sys.executable that uses a shebang line (this file)
exe = os.path.normpath(os.path.splitext(__file__)[0] + '.py')
assert (
get_script_header('#!/usr/local/bin/python', executable=exe)
==
'#!/usr/bin/env %s\n' % exe
)
with contexts.quiet() as (stdout, stderr):
# A mock sys.executable that uses a shebang line (this file)
exe = os.path.normpath(os.path.splitext(__file__)[0] + '.py')
assert (
get_script_header('#!/usr/local/bin/python', executable=exe)
==
'#!/usr/bin/env %s\n' % exe
)
# Ensure we generate what is basically a broken shebang line
# when there's options, with a warning emitted
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment