|
|
@ -117,14 +117,14 @@ class TestRecursiveFinder(object):
|
|
|
|
data = b'#!/usr/bin/python\ndef something(:\n pass\n'
|
|
|
|
data = b'#!/usr/bin/python\ndef something(:\n pass\n'
|
|
|
|
with pytest.raises(ansible.errors.AnsibleError) as exec_info:
|
|
|
|
with pytest.raises(ansible.errors.AnsibleError) as exec_info:
|
|
|
|
recursive_finder(name, data, *finder_containers)
|
|
|
|
recursive_finder(name, data, *finder_containers)
|
|
|
|
assert 'Unable to import fake_module due to invalid syntax' in str(exec_info)
|
|
|
|
assert 'Unable to import fake_module due to invalid syntax' in str(exec_info.value)
|
|
|
|
|
|
|
|
|
|
|
|
def test_module_utils_with_identation_error(self, finder_containers):
|
|
|
|
def test_module_utils_with_identation_error(self, finder_containers):
|
|
|
|
name = 'fake_module'
|
|
|
|
name = 'fake_module'
|
|
|
|
data = b'#!/usr/bin/python\n def something():\n pass\n'
|
|
|
|
data = b'#!/usr/bin/python\n def something():\n pass\n'
|
|
|
|
with pytest.raises(ansible.errors.AnsibleError) as exec_info:
|
|
|
|
with pytest.raises(ansible.errors.AnsibleError) as exec_info:
|
|
|
|
recursive_finder(name, data, *finder_containers)
|
|
|
|
recursive_finder(name, data, *finder_containers)
|
|
|
|
assert 'Unable to import fake_module due to unexpected indent' in str(exec_info)
|
|
|
|
assert 'Unable to import fake_module due to unexpected indent' in str(exec_info.value)
|
|
|
|
|
|
|
|
|
|
|
|
def test_from_import_toplevel_package(self, finder_containers, mocker):
|
|
|
|
def test_from_import_toplevel_package(self, finder_containers, mocker):
|
|
|
|
if PY2:
|
|
|
|
if PY2:
|
|
|
|