mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-27 21:01: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
|
@ -28,7 +28,6 @@ from io import StringIO
|
|||
|
||||
from ansible.compat.tests import unittest
|
||||
from ansible.compat.tests.mock import patch, MagicMock, PropertyMock
|
||||
|
||||
from ansible.errors import AnsibleConnectionFailure
|
||||
from ansible.playbook.play_context import PlayContext
|
||||
|
||||
|
@ -38,6 +37,7 @@ builtin_import = __import__
|
|||
|
||||
mock_ncclient = MagicMock(name='ncclient')
|
||||
|
||||
|
||||
def import_mock(name, *args):
|
||||
if name.startswith('ncclient'):
|
||||
return mock_ncclient
|
||||
|
@ -50,6 +50,7 @@ else:
|
|||
with patch('__builtin__.__import__', side_effect=import_mock):
|
||||
from ansible.plugins.connection import netconf
|
||||
|
||||
|
||||
class TestNetconfConnectionClass(unittest.TestCase):
|
||||
|
||||
def test_netconf_init(self):
|
||||
|
@ -117,5 +118,3 @@ class TestNetconfConnectionClass(unittest.TestCase):
|
|||
self.assertEqual(1, rc)
|
||||
self.assertEqual('', out)
|
||||
self.assertEqual('unable to parse request', err)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue