mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-02 11:22:47 +00:00
Enable most unittests on python3 (just some vault unittests and a logging one left) (#17240)
Make some python3 fixes to make the unittests pass: * galaxy imports * dictionary iteration in role requirements * swap_stdout helper for unittests * Normalize to text string in a facts.py function
This commit is contained in:
@@ -32,7 +32,6 @@ from ansible.module_utils import basic
|
||||
|
||||
empty_invocation = {u'module_args': {}}
|
||||
|
||||
@unittest.skipIf(sys.version_info[0] >= 3, "Python 3 is not supported on targets (yet)")
|
||||
class TestAnsibleModuleExitJson(unittest.TestCase):
|
||||
def setUp(self):
|
||||
args = json.dumps(dict(ANSIBLE_MODULE_ARGS={}))
|
||||
@@ -90,7 +89,6 @@ class TestAnsibleModuleExitJson(unittest.TestCase):
|
||||
return_val = json.loads(self.fake_stream.getvalue())
|
||||
self.assertEquals(return_val, dict(changed=True, msg='success', invocation=empty_invocation))
|
||||
|
||||
@unittest.skipIf(sys.version_info[0] >= 3, "Python 3 is not supported on targets (yet)")
|
||||
class TestAnsibleModuleExitValuesRemoved(unittest.TestCase):
|
||||
OMIT = 'VALUE_SPECIFIED_IN_NO_LOG_PARAMETER'
|
||||
dataset = (
|
||||
|
||||
@@ -42,7 +42,6 @@ class OpenBytesIO(BytesIO):
|
||||
pass
|
||||
|
||||
|
||||
@unittest.skipIf(sys.version_info[0] >= 3, "Python 3 is not supported on targets (yet)")
|
||||
class TestAnsibleModuleRunCommand(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.cmd_out = {
|
||||
|
||||
Reference in New Issue
Block a user