mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-28 21:31:26 -07:00
Remove use of simplejson throughout code base (#43548)
* Remove use of simplejson throughout code base. Fixes #42761 * Address failing tests * Remove simplejson from contrib and other outlying files * Add changelog fragment for simplejson removal
This commit is contained in:
parent
96346938ee
commit
c1c229c6d4
55 changed files with 73 additions and 285 deletions
|
@ -66,18 +66,15 @@ class TestImports(ModuleTestCase):
|
|||
def _mock_import(name, *args, **kwargs):
|
||||
if name == 'json':
|
||||
raise ImportError
|
||||
elif name == 'simplejson':
|
||||
sj = MagicMock()
|
||||
sj.__version__ = '3.10.0'
|
||||
return sj
|
||||
return realimport(name, *args, **kwargs)
|
||||
|
||||
self.clear_modules(['json', 'ansible.module_utils.basic'])
|
||||
mod = builtins.__import__('ansible.module_utils.basic')
|
||||
builtins.__import__('ansible.module_utils.basic')
|
||||
|
||||
self.clear_modules(['json', 'ansible.module_utils.basic'])
|
||||
mock_import.side_effect = _mock_import
|
||||
mod = builtins.__import__('ansible.module_utils.basic')
|
||||
with self.assertRaises(SystemExit):
|
||||
builtins.__import__('ansible.module_utils.basic')
|
||||
|
||||
# FIXME: doesn't work yet
|
||||
# @patch.object(builtins, 'bytes')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue