def METHOD_NAME(runner, empty_netrc, user):
    with runner.isolated_filesystem(), mock.patch(
        "wandb.sdk.lib.apikey.len", return_value=40
    ):
        result = runner.invoke(cli.login, [user])
        debug_result(result, "login")
        result = runner.invoke(cli.init, input="y\n\n\n")
        debug_result(result, "init")
        assert result.exit_code == 0
        with open("netrc") as f:
            generated_netrc = f.read()
        with open("wandb/settings") as f:
            generated_wandb = f.read()
        assert user in generated_netrc
        assert user in generated_wandb