code: def test_mlflow_login(tmp_path, monkeypatch):
      # Mock `input()` and `getpass()` to return host, username and password in order.
      with patch(
          "builtins.input",
          side_effect=[
              "https://community.cloud.databricks.com/",
              "dummyusername",
          ],
      ), patch("getpass.getpass", side_effect=["dummypassword"]):
          file_name = f"{tmp_path}/.databrickscfg"
          profile = "TEST"
          monkeypatch.setenv("DATABRICKS_CONFIG_FILE", file_name)
          monkeypatch.setenv("DATABRICKS_CONFIG_PROFILE", profile)
  
          def success():
              return
  
          with patch(
              "mlflow.utils.credentials._validate_databricks_auth",
              side_effect=[
                  MlflowException("Invalid databricks credentials."),
                  success(),
              ],
          ):
              login("databricks")
  
      with open(file_name) as f:
          lines = f.readlines()
          assert lines[0] == "[TEST]\n"
          assert (
              lines[1]
              == "host = https://community.cloud.databricks.com/\n"
          )
          assert lines[2] == "username = dummyusername\n"
          assert lines[3] == "password = dummypassword\n"
  
      # Assert that the tracking URI is set to the databricks.
      assert get_tracking_uri() == "databricks"
  
file_path: mlflow/tests/utils/test_credentials.py
imports: from unittest import mock
  from unittest.mock import patch
  import pytest
  from mlflow import get_tracking_uri
  from mlflow.environment_variables import MLFLOW_TRACKING_PASSWORD, MLFLOW_TRACKING_USERNAME
  from mlflow.exceptions import MlflowException
  from mlflow.utils.credentials import login, read_mlflow_creds
label_desc: Use image node_id 4 for calling a global function with example usage: test_mlflow_login(tmp_path, monkeypatch) without return types