mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 20:31:27 -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,13 +21,12 @@ from __future__ import (absolute_import, division, print_function)
|
|||
__metaclass__ = type
|
||||
|
||||
import os
|
||||
from ansible.compat.tests import unittest
|
||||
from ansible.compat.tests import BUILTINS
|
||||
|
||||
from ansible.compat.tests import BUILTINS, unittest
|
||||
from ansible.compat.tests.mock import mock_open, patch, MagicMock
|
||||
|
||||
from ansible.plugins import MODULE_CACHE, PATH_CACHE, PLUGIN_PATH_CACHE, PluginLoader
|
||||
|
||||
|
||||
class TestErrors(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
|
@ -69,15 +68,15 @@ class TestErrors(unittest.TestCase):
|
|||
self.assertEqual(pl._get_paths(), ['/path/one', '/path/two'])
|
||||
|
||||
# NOT YET WORKING
|
||||
#def fake_glob(path):
|
||||
# if path == 'test/*':
|
||||
# return ['test/foo', 'test/bar', 'test/bam']
|
||||
# elif path == 'test/*/*'
|
||||
#m._paths = None
|
||||
#mock_glob = MagicMock()
|
||||
#mock_glob.return_value = []
|
||||
#with patch('glob.glob', mock_glob):
|
||||
# pass
|
||||
# def fake_glob(path):
|
||||
# if path == 'test/*':
|
||||
# return ['test/foo', 'test/bar', 'test/bam']
|
||||
# elif path == 'test/*/*'
|
||||
# m._paths = None
|
||||
# mock_glob = MagicMock()
|
||||
# mock_glob.return_value = []
|
||||
# with patch('glob.glob', mock_glob):
|
||||
# pass
|
||||
|
||||
def assertPluginLoaderConfigBecomes(self, arg, expected):
|
||||
pl = PluginLoader('test', '', arg, 'test_plugin')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue