Example #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
Example #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
Example #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
Example #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
Example #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