mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-02 19:32:47 +00:00
test/: PEP8 compliancy (#24803)
* test/: PEP8 compliancy - Make PEP8 compliant * Python3 chokes on casting int to bytes (#24952) But if we tell the formatter that the var is a number, it works
This commit is contained in:
committed by
John R Barker
parent
31c59ad5f9
commit
4efec414e7
@@ -51,7 +51,7 @@ class TestAnsibleModuleSysLogSmokeTest(unittest.TestCase):
|
||||
|
||||
ansible.module_utils.basic._ANSIBLE_ARGS = None
|
||||
self.am = ansible.module_utils.basic.AnsibleModule(
|
||||
argument_spec = dict(),
|
||||
argument_spec=dict(),
|
||||
)
|
||||
self.am._name = 'unittest'
|
||||
|
||||
@@ -89,7 +89,7 @@ class TestAnsibleModuleJournaldSmokeTest(unittest.TestCase):
|
||||
|
||||
ansible.module_utils.basic._ANSIBLE_ARGS = None
|
||||
self.am = ansible.module_utils.basic.AnsibleModule(
|
||||
argument_spec = dict(),
|
||||
argument_spec=dict(),
|
||||
)
|
||||
self.am._name = 'unittest'
|
||||
|
||||
@@ -120,7 +120,7 @@ class TestAnsibleModuleLogSyslog(unittest.TestCase):
|
||||
b'Byte string': b'Byte string',
|
||||
u'Toshio くらとみ non-ascii test'.encode('utf-8'): u'Toshio くらとみ non-ascii test'.encode('utf-8'),
|
||||
b'non-utf8 :\xff: test': b'non-utf8 :\xff: test'.decode('utf-8', 'replace').encode('utf-8'),
|
||||
}
|
||||
}
|
||||
|
||||
py3_output_data = {
|
||||
u'Text string': u'Text string',
|
||||
@@ -128,7 +128,7 @@ class TestAnsibleModuleLogSyslog(unittest.TestCase):
|
||||
b'Byte string': u'Byte string',
|
||||
u'Toshio くらとみ non-ascii test'.encode('utf-8'): u'Toshio くらとみ non-ascii test',
|
||||
b'non-utf8 :\xff: test': b'non-utf8 :\xff: test'.decode('utf-8', 'replace')
|
||||
}
|
||||
}
|
||||
|
||||
def setUp(self):
|
||||
args = json.dumps(dict(ANSIBLE_MODULE_ARGS={}))
|
||||
@@ -138,7 +138,7 @@ class TestAnsibleModuleLogSyslog(unittest.TestCase):
|
||||
|
||||
ansible.module_utils.basic._ANSIBLE_ARGS = None
|
||||
self.am = ansible.module_utils.basic.AnsibleModule(
|
||||
argument_spec = dict(),
|
||||
argument_spec=dict(),
|
||||
)
|
||||
self.am._name = 'unittest'
|
||||
|
||||
@@ -189,7 +189,7 @@ class TestAnsibleModuleLogJournal(unittest.TestCase):
|
||||
b'Byte string': u'Byte string',
|
||||
u'Toshio くらとみ non-ascii test'.encode('utf-8'): u'Toshio くらとみ non-ascii test',
|
||||
b'non-utf8 :\xff: test': b'non-utf8 :\xff: test'.decode('utf-8', 'replace')
|
||||
}
|
||||
}
|
||||
|
||||
# overriding run lets us use context managers for setup/teardown-esque behavior
|
||||
def setUp(self):
|
||||
@@ -200,7 +200,7 @@ class TestAnsibleModuleLogJournal(unittest.TestCase):
|
||||
|
||||
ansible.module_utils.basic._ANSIBLE_ARGS = None
|
||||
self.am = ansible.module_utils.basic.AnsibleModule(
|
||||
argument_spec = dict(),
|
||||
argument_spec=dict(),
|
||||
)
|
||||
self.am._name = 'unittest'
|
||||
|
||||
@@ -270,4 +270,3 @@ class TestAnsibleModuleLogJournal(unittest.TestCase):
|
||||
# We added this journal field
|
||||
self.assertIn('TEST', mock_func.call_args[1])
|
||||
self.assertIn('log unittest', mock_func.call_args[1]['TEST'])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user