-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Plamen Dimitrov <[email protected]>
- Loading branch information
Showing
2 changed files
with
14 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
# Copyright: Intra2net AG and aexpect contributors | ||
# Author: Plamen Dimitrov <[email protected]> | ||
# | ||
# selftests pylint: disable=C0111,C0111,W0613,R0913 | ||
# selftests pylint: disable=C0111,C0111,W0613,R0913,E1101 | ||
|
||
import os | ||
import glob | ||
|
@@ -28,14 +28,14 @@ | |
|
||
|
||
# noinspection PyUnusedLocal | ||
def _local_login(client, host, port, username, password, prompt, | ||
def _local_login(_client, host, port, username, password, prompt, | ||
linesep="\n", log_filename=None, log_function=None, | ||
timeout=10, internal_timeout=10, interface=None): | ||
return RemoteSession("sh", prompt=prompt, client=client) | ||
return RemoteSession("sh", prompt=prompt, client=_client) | ||
|
||
|
||
# noinspection PyUnusedLocal | ||
def _local_copy(address, client, username, password, port, local_path, | ||
def _local_copy(address, _client, username, password, port, local_path, | ||
remote_path, limit="", log_filename=None, log_function=None, | ||
verbose=False, timeout=600, interface=None, filesize=None, | ||
directory=True): | ||
|
@@ -54,11 +54,11 @@ def setUp(self): | |
|
||
self.has_remote_objects = hasattr(remote_door, "Pyro4") | ||
if self.has_remote_objects: | ||
self.Pyro4 = mock.patch(remote_door.Pyro4) | ||
self.pyro = mock.patch(remote_door.Pyro4) | ||
self.server = mock.patch(remote_door.server) | ||
self.nameserver = mock.patch(remote_door.nameserver) | ||
else: | ||
self.Pyro4 = remote_door.Pyro4 = mock.MagicMock() | ||
self.pyro = remote_door.Pyro4 = mock.MagicMock() | ||
self.server = remote_door.server = mock.MagicMock() | ||
self.nameserver = remote_door.nameserver = mock.MagicMock() | ||
|
||
|
@@ -75,7 +75,7 @@ def tearDown(self): | |
self.session.close() | ||
|
||
if self.has_remote_objects: | ||
self.Pyro4.stop() | ||
self.pyro.stop() | ||
self.server.stop() | ||
self.nameserver.stop() | ||
else: | ||
|
@@ -172,8 +172,8 @@ def test_get_remote_object(self): | |
"""Test that a remote object can be retrieved properly.""" | ||
self.session = mock.MagicMock(name='session') | ||
self.session.client = "ssh" | ||
disconnect = self.Pyro4.errors.PyroError = Exception | ||
self.Pyro4.Proxy.side_effect = [disconnect("no such object"), mock.DEFAULT] | ||
disconnect = self.pyro.errors.PyroError = Exception | ||
self.pyro.Proxy.side_effect = [disconnect("no such object"), mock.DEFAULT] | ||
self.session.get_output.return_value = "Local object sharing ready\n" | ||
self.session.get_output.return_value += "RESULT = None\n" | ||
|
||
|
@@ -242,7 +242,7 @@ def test_import_remote_exceptions(self): | |
"aexpect.remote.LoginError", | ||
"aexpect.remote.TransferError"] | ||
remote_door.import_remote_exceptions(preselected_exceptions) | ||
register_method = self.Pyro4.util.SerializerBase.register_dict_to_class | ||
register_method = self.pyro.util.SerializerBase.register_dict_to_class | ||
self.assertEqual(len(register_method.mock_calls), 3) | ||
|
||
def get_first_arg(call): | ||
|