mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00: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:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user