Esempio n. 1
0
def test_ssh_host_override_from_config(mock_file, mock_exists, config,
                                       expected_host):
    remote = RemoteSSH(None, config)

    mock_exists.assert_called_with(RemoteSSH.ssh_config_filename())
    mock_file.assert_called_with(RemoteSSH.ssh_config_filename())
    assert remote.host == expected_host
Esempio n. 2
0
def test_ssh_keyfile(mock_file, mock_exists, config, expected_keyfile):
    remote = RemoteSSH(None, config)

    mock_exists.assert_called_with(RemoteSSH.ssh_config_filename())
    mock_file.assert_called_with(RemoteSSH.ssh_config_filename())
    assert remote.keyfile == expected_keyfile
Esempio n. 3
0
def test_ssh_port(mock_file, mock_exists, config, expected_port):
    remote = RemoteSSH(None, config)

    mock_exists.assert_called_with(RemoteSSH.ssh_config_filename())
    mock_file.assert_called_with(RemoteSSH.ssh_config_filename())
    assert remote.path_info.port == expected_port
Esempio n. 4
0
def test_ssh_gss_auth(mock_file, mock_exists, config, expected_gss_auth):
    remote = RemoteSSH(None, config)

    mock_exists.assert_called_with(RemoteSSH.ssh_config_filename())
    mock_file.assert_called_with(RemoteSSH.ssh_config_filename())
    assert remote.gss_auth == expected_gss_auth
Esempio n. 5
0
def test_ssh_user(mock_file, mock_exists, dvc, config, expected_user):
    remote = RemoteSSH(dvc, config)

    mock_exists.assert_called_with(RemoteSSH.ssh_config_filename())
    mock_file.assert_called_with(RemoteSSH.ssh_config_filename())
    assert remote.path_info.user == expected_user