mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 04:11:25 -07: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:
parent
31c59ad5f9
commit
4efec414e7
110 changed files with 1702 additions and 1547 deletions
|
@ -19,10 +19,10 @@
|
|||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
from ansible.parsing.mod_args import ModuleArgsParser
|
||||
from ansible.errors import AnsibleParserError
|
||||
|
||||
from ansible.compat.tests import unittest
|
||||
from ansible.errors import AnsibleParserError
|
||||
from ansible.parsing.mod_args import ModuleArgsParser
|
||||
|
||||
|
||||
class TestModArgsDwim(unittest.TestCase):
|
||||
|
||||
|
@ -47,9 +47,9 @@ class TestModArgsDwim(unittest.TestCase):
|
|||
self._debug(mod, args, to)
|
||||
self.assertEqual(mod, 'command')
|
||||
self.assertEqual(args, dict(
|
||||
_raw_params = 'echo hi',
|
||||
_uses_shell = True,
|
||||
))
|
||||
_raw_params='echo hi',
|
||||
_uses_shell=True,
|
||||
))
|
||||
self.assertIsNone(to)
|
||||
|
||||
def test_basic_command(self):
|
||||
|
@ -58,8 +58,8 @@ class TestModArgsDwim(unittest.TestCase):
|
|||
self._debug(mod, args, to)
|
||||
self.assertEqual(mod, 'command')
|
||||
self.assertEqual(args, dict(
|
||||
_raw_params = 'echo hi',
|
||||
))
|
||||
_raw_params='echo hi',
|
||||
))
|
||||
self.assertIsNone(to)
|
||||
|
||||
def test_shell_with_modifiers(self):
|
||||
|
@ -68,11 +68,11 @@ class TestModArgsDwim(unittest.TestCase):
|
|||
self._debug(mod, args, to)
|
||||
self.assertEqual(mod, 'command')
|
||||
self.assertEqual(args, dict(
|
||||
creates = '/tmp/baz',
|
||||
removes = '/tmp/bleep',
|
||||
_raw_params = '/bin/foo',
|
||||
_uses_shell = True,
|
||||
))
|
||||
creates='/tmp/baz',
|
||||
removes='/tmp/bleep',
|
||||
_raw_params='/bin/foo',
|
||||
_uses_shell=True,
|
||||
))
|
||||
self.assertIsNone(to)
|
||||
|
||||
def test_normal_usage(self):
|
||||
|
@ -127,4 +127,3 @@ class TestModArgsDwim(unittest.TestCase):
|
|||
|
||||
m = ModuleArgsParser(dict(ping='data=hi', shell='echo hi'))
|
||||
self.assertRaises(AnsibleParserError, m.parse)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue