← GDG /

#185 gdtest_ref_members_false

#185 gdtest_ref_members_false OK CONFIG
Reference config with members: false on a class.
Reference config with members: false on a class. The class should appear but its methods should NOT be listed separately.
View Site → Build Log ๐Ÿงช Test Coverage

Build Mode

● Has great-docs.yml

This package ships a pre-supplied config. The great-docs init step is skipped and great-docs build uses the spec-defined configuration directly. Tests specific config options and their rendered output.

Dimensions

P2
P2members: falsereference

Source Files

๐Ÿ“ gdtest_ref_members_false/
๐Ÿ“„ __init__.py
"""Test package for reference config with members: false."""

from .core import Engine, start_engine

__all__ = ["Engine", "start_engine"]
๐Ÿ“„ core.py
"""Core Engine class and start_engine function."""


class Engine:
    """A configurable engine for processing tasks.

    Parameters
    ----------
    name : str
        The name of the engine.

    Examples
    --------
    >>> e = Engine("turbo")
    >>> e.status()
    'idle'
    """

    def __init__(self, name: str):
        """Initialize the engine.

        Parameters
        ----------
        name : str
            The name of the engine.
        """
        self.name = name
        self._running = False

    def start(self) -> None:
        """Start the engine.

        Returns
        -------
        None
        """
        self._running = True

    def stop(self) -> None:
        """Stop the engine.

        Returns
        -------
        None
        """
        self._running = False

    def restart(self) -> None:
        """Restart the engine by stopping and starting it.

        Returns
        -------
        None
        """
        self.stop()
        self.start()

    def status(self) -> str:
        """Return the current status of the engine.

        Returns
        -------
        str
            Either 'running' or 'idle'.
        """
        return "running" if self._running else "idle"

    def configure(self, options: dict) -> None:
        """Configure the engine with the given options.

        Parameters
        ----------
        options : dict
            A dictionary of configuration options.

        Returns
        -------
        None
        """
        self._options = options


def start_engine(config: dict) -> "Engine":
    """Create and start an engine with the given configuration.

    Parameters
    ----------
    config : dict
        A dictionary of engine configuration options.

    Returns
    -------
    Engine
        A running Engine instance.

    Examples
    --------
    >>> engine = start_engine({"name": "main"})
    >>> engine.status()
    'running'
    """
    engine = Engine(config.get("name", "default"))
    engine.start()
    return engine
๐Ÿ“„ README.md
# gdtest-ref-members-false

Test reference config with members: false.
๐Ÿ“„ great-docs.yml
reference:
  - title: Core
    desc: Core API
    contents:
      - name: Engine
        members: false
      - name: start_engine