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
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"
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("")