コード例 #1
0
 def test_python_via_env(self, templar):
     assert amc._get_shebang(u'/usr/bin/python', {u'assible_python_interpreter': u'/usr/bin/env python'}, templar) == \
         (u'#!/usr/bin/env python', u'/usr/bin/env python')
コード例 #2
0
 def test_with_args(self, templar):
     assert amc._get_shebang(u'/usr/bin/python', {u'assible_python_interpreter': u'/usr/bin/python3'}, templar, args=('-tt', '-OO')) == \
         (u'#!/usr/bin/python3 -tt -OO', u'/usr/bin/python3')
コード例 #3
0
 def test_non_python_interpreter_in_task_vars(self, templar):
     assert amc._get_shebang(u'/usr/bin/ruby', {u'assible_ruby_interpreter': u'/usr/local/bin/ruby'}, templar) == \
         (u'#!/usr/local/bin/ruby', u'/usr/local/bin/ruby')
コード例 #4
0
 def test_interpreter_set_in_task_vars(self, templar):
     assert amc._get_shebang(u'/usr/bin/python', {u'assible_python_interpreter': u'/usr/bin/pypy'}, templar) == \
         (u'#!/usr/bin/pypy', u'/usr/bin/pypy')
コード例 #5
0
 def test_non_python_interpreter(self, templar):
     assert amc._get_shebang(u'/usr/bin/ruby', {},
                             templar) == (None, u'/usr/bin/ruby')
コード例 #6
0
 def test_no_interpreter_set(self, templar):
     # normally this would return /usr/bin/python, but so long as we're defaulting to auto python discovery, we'll get
     # an InterpreterDiscoveryRequiredError here instead
     with pytest.raises(InterpreterDiscoveryRequiredError):
         amc._get_shebang(u'/usr/bin/python', {}, templar)