def test_get_new_command(ssh_error, monkeypatch): errormsg, _, _, _ = ssh_error method = Mock() monkeypatch.setattr('thefuck.rules.ssh_known_hosts.remove_offending_keys', method) assert get_new_command(Command('ssh user@host', '', errormsg), None) == 'ssh user@host' assert method.call_count
def test_get_new_command(ssh_error, monkeypatch): errormsg, _, _, _ = ssh_error assert get_new_command(Command('ssh user@host', stderr=errormsg)) == 'ssh user@host'
def test_get_new_command(ssh_error, monkeypatch): errormsg, _, _, _ = ssh_error assert get_new_command(Command("ssh user@host", errormsg)) == "ssh user@host"
def test_get_new_command(ssh_error, monkeypatch): errormsg, _, _, _ = ssh_error assert get_new_command(Command("ssh user@host", stderr=errormsg), None) == "ssh user@host"