code: def test_authentication_with_environment_vars(
      browser_login: mock.MagicMock,
  ):
      os.environ.setdefault("LIGHTNING_USER_ID", "abc")
      os.environ.setdefault("LIGHTNING_API_KEY", "abc")
  
      auth = login.Auth()
      auth.clear()
      auth.authenticate()
  
      assert auth.user_id == "abc"
      assert auth.auth_header == "Basic YWJjOmFiYw=="
      assert auth.authenticate() == auth.auth_header
      # should not run login flow when env vars are passed
      browser_login.assert_not_called()
  
      # Check credentials file
      assert auth.secrets_file.exists()
      assert auth.load() is True
  
file_path: pytorch-lightning/tests/tests_app/utilities/test_login.py
imports: import os
  from unittest import mock
  import pytest
  import requests
  from lightning.app.utilities import login
label_desc: Use image node_id 3 for calling a global function with example usage: test_authentication_with_environment_vars(browser_login) without return types