aboutsummaryrefslogtreecommitdiffstats
path: root/app/test/fetch/cli_fetch/test_cli_access.py
diff options
context:
space:
mode:
authoryayogev <yaronyogev@gmail.com>2017-08-23 15:45:16 +0300
committerIlia Abashin <abashinos@gmail.com>2017-08-23 14:03:25 +0000
commitd4b42e52c4a4277e2c145f090b486c6a7ca4c306 (patch)
tree88f605fcad8d67e886013a7b5fa3638d31d81496 /app/test/fetch/cli_fetch/test_cli_access.py
parentf512c7323ec5dffa71790ab688fe0a0d85dcaf20 (diff)
add -q to ssh to ignore warnnings
Change-Id: I311203cd7eea49c1f82624b2aefc86a687c78861 Signed-off-by: yayogev <yaronyogev@gmail.com>
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()