Ejemplo n.º 1
0
def do_login(username: str, password: str):
    """
    Login to Registry account and save auth token in config.

    :param username: str username.
    :param password: str password.

    :return: None
    """
    click.echo("Signing in as {}...".format(username))
    token = registry_login(username, password)
    _update_cli_config({AUTH_TOKEN_KEY: token})
    click.echo("Successfully signed in: {}.".format(username))
Ejemplo n.º 2
0
def login(username, password):
    """Login to Registry account."""
    click.echo("Signing in as {}...".format(username))
    token = registry_login(username, password)
    _update_cli_config({AUTH_TOKEN_KEY: token})
    click.echo("Successfully signed in: {}.".format(username))
Ejemplo n.º 3
0
 def test_registry_login_positive(self, request_api_mock):
     """Test for registry_login method positive result."""
     result = registry_login("username", "password")
     expected_result = "key"
     self.assertEqual(result, expected_result)
     request_api_mock.assert_called_once()