Пример #1
0
 def test__ssh_execute(self, exec_ssh_mock):
     ssh_cmd = "somecmd"
     expected = ['a', 'b', 'c']
     exec_ssh_mock.return_value = ('\n'.join(expected), '')
     lst = ssh._ssh_execute(self.sshclient, ssh_cmd)
     exec_ssh_mock.assert_called_once_with(self.sshclient, ssh_cmd)
     self.assertEqual(expected, lst)
Пример #2
0
 def test__ssh_execute(self):
     ssh_cmd = "somecmd"
     expected = ['a', 'b', 'c']
     self.exec_ssh_mock.return_value = ('\n'.join(expected), '')
     lst = ssh._ssh_execute(self.sshclient, ssh_cmd)
     self.exec_ssh_mock.assert_called_once_with(self.sshclient, ssh_cmd)
     self.assertEqual(expected, lst)
Пример #3
0
 def test__ssh_execute(self, exec_ssh_mock):
     ssh_cmd = "somecmd"
     expected = ["a", "b", "c"]
     exec_ssh_mock.return_value = ("\n".join(expected), "")
     lst = ssh._ssh_execute(self.sshclient, ssh_cmd)
     exec_ssh_mock.assert_called_once_with(self.sshclient, ssh_cmd)
     self.assertEqual(expected, lst)