예제 #1
0
def test_get_stored_password_uses_expected_profile_name(
        config_accessor, password_getter):
    mock_section = MockSection("testprofilename")
    config_accessor.get_profile.return_value = mock_section
    test_profile = "testprofilename"
    password_getter.return_value = "testpassword"
    cliprofile.get_stored_password(test_profile)
    assert password_getter.call_args[0][0].name == test_profile
예제 #2
0
def test_get_stored_password_returns_expected_password(
    config_accessor, password_getter
):
    mock_section = MockSection("testprofilename")
    config_accessor.get_profile.return_value = mock_section
    password_getter.return_value = "testpassword"
    assert cliprofile.get_stored_password("testprofilename") == "testpassword"
예제 #3
0
def show(profile_name):
    """Print the details of a profile."""
    c42profile = cliprofile.get_profile(profile_name)
    echo("\n{}:".format(c42profile.name))
    echo("\t* username = {}".format(c42profile.username))
    echo("\t* authority url = {}".format(c42profile.authority_url))
    echo("\t* ignore-ssl-errors = {}".format(c42profile.ignore_ssl_errors))
    if cliprofile.get_stored_password(c42profile.name) is not None:
        echo("\t* A password is set.")
    echo("")
    echo("")