aboutsummaryrefslogtreecommitdiffstats
path: root/app/test/fetch/cli_fetch/test_cli_access.py
diff options
context:
space:
mode:
authorYaron Yogev <yaronyogev@gmail.com>2017-08-23 14:12:01 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-08-23 14:12:01 +0000
commit2b7d3add81ac79e39d7cef6e7ccdac4e00dcbf77 (patch)
tree07997d4b08506f3938d791972a02ffb59bdedff5 /app/test/fetch/cli_fetch/test_cli_access.py
parent3abb112a58ea4b9d8229ce628b72a5a0b66ec54f (diff)
parentd4b42e52c4a4277e2c145f090b486c6a7ca4c306 (diff)
Merge "add -q to ssh to ignore warnnings"
Diffstat (limited to 'app/test/fetch/cli_fetch/test_cli_access.py')
-rw-r--r--app/test/fetch/cli_fetch/test_cli_access.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/app/test/fetch/cli_fetch/test_cli_access.py b/app/test/fetch/cli_fetch/test_cli_access.py
index be80619..d32e1ed 100644
--- a/app/test/fetch/cli_fetch/test_cli_access.py
+++ b/app/test/fetch/cli_fetch/test_cli_access.py
@@ -23,12 +23,10 @@ class TestCliAccess(TestFetch):
self.configure_environment()
self.cli_access = CliAccess()
- @patch("utils.ssh_conn.SshConn.exec")
def check_run_result(self, is_gateway_host,
enable_cache,
cached_command_result, exec_result,
- expected_result, err_msg,
- ssh_con_exec):
+ expected_result, err_msg):
# mock cached commands
if not is_gateway_host:
self.cli_access.cached_commands = {
@@ -38,17 +36,15 @@ class TestCliAccess(TestFetch):
self.cli_access.cached_commands = {
GATEWAY_CACHED_COMMAND: cached_command_result
}
- original_is_gateway_host = SshConn.is_gateway_host
- SshConn.is_gateway_host = MagicMock(return_value=is_gateway_host)
- ssh_con_exec.return_value = exec_result
+
+ self.ssh_conn.exec.return_value = exec_result
+ self.ssh_conn.is_gateway_host.return_value = is_gateway_host
result = self.cli_access.run(COMMAND, COMPUTE_HOST_ID,
on_gateway=False, enable_cache=enable_cache)
self.assertEqual(result, expected_result, err_msg)
# reset the cached commands after testing
self.cli_access.cached_commands = {}
- # reset method
- SshConn.is_gateway_host = original_is_gateway_host
def test_run(self):
curr_time = time.time()