bundle.testing.tools.utils ========================== .. py:module:: bundle.testing.tools.utils Attributes ---------- .. autoapisummary:: bundle.testing.tools.utils.logger Functions --------- .. autoapisummary:: bundle.testing.tools.utils.ensure_path bundle.testing.tools.utils.class_instance_name bundle.testing.tools.utils.retrieves_tests_paths Module Contents --------------- .. py:data:: logger .. py:function:: ensure_path(path: pathlib.Path | str) -> pathlib.Path Ensures existence of a path's directories. For file paths, creates missing parent directories. For directory paths, creates the directory if missing. Logs creation actions. :param path: Target file or directory path. :type path: Path :returns: Verified path :rtype: Path .. py:function:: class_instance_name(class_instance: object) .. py:function:: retrieves_tests_paths(category: str, ref_dir: str | pathlib.Path, tmp_dir: str | pathlib.Path, class_instance: object, suffix: str, extension: str = 'json') -> tuple[pathlib.Path, pathlib.Path, pathlib.Path, pathlib.Path] Generate and ensure paths for reference, temporary, failed tests, and their logs based on the test category, directory references, test instance, and file details. :param category: A '/' separated string defining the test category hierarchy. :type category: str :param ref_dir: The base directory for reference files. :type ref_dir: str | Path :param tmp_dir: The base directory for temporary test files. :type tmp_dir: str | Path :param class_instance: The test class instance to include in the filename. :type class_instance: object :param suffix: Suffix to append to the base filename, typically a test identifier. :type suffix: str :param extension: File extension for the test files. Defaults to "json". :type extension: str, optional :returns: A tuple containing paths for reference, temporary, failed test files, and failed test logs. :rtype: tuple[Path, Path, Path, Path]