from typing import Optional
from pathlib import Path


def get_resource(filename: str, path: Optional[str] = None) -> str:
    """A utility method to get the absolute path to a resource in the test suite.

    Args:
        filename: the name of the file to get.
        path: an optional path relative to the root of the test suite.

    Returns:
        The absolute path of the file.
    """
    root = Path(__file__).parent
    full_path = root if path is None else root / Path(path)
    return str(full_path / filename)