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:
Dag Wieers 2017-05-30 19:05:19 +02:00 committed by John R Barker
parent 31c59ad5f9
commit 4efec414e7
110 changed files with 1702 additions and 1547 deletions

View file

@ -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)