def test_env_file(
    tmp_path: Path,
    file_map: dict[str, str],
    env_file: str,
    exp_env_vars: dict[str, str],
) -> None:
    """Test that the env_file method loads environment variables from a file.

    Args:
        tmp_path: The pytest tmp_path object.
        file_map: A mapping of file names to their contents.
        env_file: The path to the environment file to load.
        exp_env_vars: The expected environment variables after loading the file.
    """
    for filename, content in file_map.items():
        (tmp_path / filename).write_text(content)

    _ = rx.Config(
        app_name="test_env_file",
        env_file=env_file.format(path=tmp_path, sep=os.pathsep),
    )
    for key, value in exp_env_vars.items():
        assert os.environ.get(key) == value
Test that the env_file method loads environment variables from a file.

    Args:
        tmp_path: The pytest tmp_path object.
        file_map: A mapping of file names to their contents.
        env_file: The path to the environment file to load.
        exp_env_vars: The expected environment variables after loading the file.
    
tests/units/test_config.py