@mock.patch("paramiko.client.SSHClient")
  @unittest.skipIf(not paramiko_installed, "paramiko not installed")
  def test_execute_command(self, ssh_client_cls):
    # Arrange
    host = "localhost"
    cmd = "ls"
    ssh = SSHEntity(host)
    ssh._ssh_cls = ssh_client_cls

    session_mock = mock.Mock()
    session_mock.recv_ready.return_value = True
    session_mock.exit_status_ready.return_value = True
    session_mock.recv.return_value = "dummy"
    stream_mock = mock.Mock()
    stream_mock.channel = session_mock
    ssh.ssh_client.exec_command.return_value = None, stream_mock, None
    def change_status(y):
      session_mock.recv_ready.return_value = False
      return "dummy"
    session_mock.recv.side_effect = change_status
    ssh.get_new_session = lambda: session_mock
    # Act
    ssh.execute_command(cmd)
    # Assert
    ssh.ssh_client.exec_command.assert_called_once_with(cmd)
    self.assertTrue(1 >= session_mock.recv.call_count)
dataset/ETHPy150Open ucb-sts/sts/tests/unit/sts/entities/base_test.py/SSHEntityTest.test_execute_command/swapped operands of `>=`