ansible/test/units
Marius Gedminas 240c388e6c Fix a test failure on Python 3.6 (#20030)
* Fix a test failure on Python 3.6

tox -e py36 failed with

    ======================================================================
    ERROR: test_action_base__execute_module (units.plugins.action.test_action.TestActionBase)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/mg/src/ansible/test/units/plugins/action/test_action.py", line 507, in test_action_base__execute_module
        self.assertEqual(action_base._execute_module(), dict(_ansible_parsed=True, rc=0, stdout="ok", stdout_lines=['ok']))
      File "/home/mg/src/ansible/lib/ansible/plugins/action/__init__.py", line 596, in _execute_module
        remote_module_path = self._connection._shell.join_path(tmp, remote_module_filename)
      File "/home/mg/opt/python36/lib/python3.6/unittest/mock.py", line 939, in __call__
        return _mock_self._mock_call(*args, **kwargs)
      File "/home/mg/opt/python36/lib/python3.6/unittest/mock.py", line 1005, in _mock_call
        ret_val = effect(*args, **kwargs)
      File "/home/mg/src/ansible/.tox/py36/lib/python3.6/posixpath.py", line 92, in join
        genericpath._check_arg_types('join', a, *p)
      File "/home/mg/src/ansible/.tox/py36/lib/python3.6/genericpath.py", line 149, in _check_arg_types
        (funcname, s.__class__.__name__)) from None
    TypeError: join() argument must be str or bytes, not 'MagicMock'

because os.path.join() now checks argument types since Python 3.6 (due
to pathlib support, I expect).

* Use a more realistic module name in test

(cherry picked from commit d9b89ca577)
2017-01-10 07:37:36 -08:00
..
cli Have unittests import mock from ansible.compat so they work on py3 without mock installed from pypi 2016-09-15 15:21:17 -07:00
contrib Add a new vmware inventory script backed by pyvmomi (#15967) 2016-05-30 20:41:48 -04:00
errors Relocate use of ERROR to display class, to avoid doubling up 2016-01-19 12:10:39 -05:00
executor Change v2_playbook_on_start logic to positively detect legacy plugins 2016-11-01 07:53:04 -07:00
inventory Changing up how host (in)equality is checked 2015-12-04 12:57:46 -05:00
inventory_test_data/group_vars Merge branch 'v2_final' into devel_switch_v2 2015-05-28 15:26:03 -05:00
mock Fix bug (#18355) where encrypted inventories fail 18355 (#18373) 2016-11-07 10:15:09 -05:00
module_utils let chdir support relative path in more modules (#16736) 2016-12-22 00:21:30 -08:00
modules Have unittests import mock from ansible.compat so they work on py3 without mock installed from pypi 2016-09-15 15:21:17 -07:00
parsing Add a encode() to AnsibleVaultEncryptedUnicode (#19840) 2017-01-04 12:17:38 -05:00
playbook make hash_params more robust in the face of many corner cases (#18701) 2016-12-05 04:02:21 -08:00
plugins Fix a test failure on Python 3.6 (#20030) 2017-01-10 07:37:36 -08:00
template Merge branch 'threaded_receiver' into devel 2016-09-20 09:18:26 -05:00
utils FEATURE: adding variable serial batches 2016-08-04 15:04:10 -05:00
vars Make ini parsing slightly more robust 2016-10-04 11:25:45 -07:00
__init__.py Making the switch to v2 2015-05-03 21:47:26 -05:00