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
|
@ -21,12 +21,11 @@ __metaclass__ = type
|
|||
|
||||
from ansible.compat.tests import unittest
|
||||
from ansible.compat.tests.mock import patch, mock_open
|
||||
from ansible.errors import AnsibleParserError
|
||||
from ansible.errors import yaml_strings
|
||||
from ansible.errors import AnsibleParserError, yaml_strings
|
||||
from ansible.module_utils.six import PY3
|
||||
|
||||
from ansible.parsing.dataloader import DataLoader
|
||||
|
||||
|
||||
class TestDataLoader(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
|
@ -39,7 +38,7 @@ class TestDataLoader(unittest.TestCase):
|
|||
def test_parse_json_from_file(self, mock_def):
|
||||
mock_def.return_value = (b"""{"a": 1, "b": 2, "c": 3}""", True)
|
||||
output = self._loader.load_from_file('dummy_json.txt')
|
||||
self.assertEqual(output, dict(a=1,b=2,c=3))
|
||||
self.assertEqual(output, dict(a=1, b=2, c=3))
|
||||
|
||||
@patch.object(DataLoader, '_get_file_contents')
|
||||
def test_parse_yaml_from_file(self, mock_def):
|
||||
|
@ -49,7 +48,7 @@ class TestDataLoader(unittest.TestCase):
|
|||
c: 3
|
||||
""", True)
|
||||
output = self._loader.load_from_file('dummy_yaml.txt')
|
||||
self.assertEqual(output, dict(a=1,b=2,c=3))
|
||||
self.assertEqual(output, dict(a=1, b=2, c=3))
|
||||
|
||||
@patch.object(DataLoader, '_get_file_contents')
|
||||
def test_parse_fail_from_file(self, mock_def):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue