← GDG /

#295 gdtest_inline_threshold

#295 gdtest_inline_threshold OK CONFIG
Tests inline_methods: 10 (custom numeric threshold)
Tests inline_methods: 10 custom numeric threshold. CompactClient (8 methods) stays inline while FullClient (12 methods) gets split into a separate method section.
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

K54
K54inline_methods: default (5)config

Source Files

๐Ÿ“ gdtest_inline_threshold/
๐Ÿ“„ __init__.py
"""Package testing inline_methods: 10 (custom threshold)."""

__version__ = "0.1.0"
__all__ = ["CompactClient", "FullClient", "connect"]


class CompactClient:
    """
    A client with 8 methods (stays inline since 8 <= 10).

    Parameters
    ----------
    host
        The server hostname.
    """

    def __init__(self, host: str):
        self.host = host

    def get(self, path: str) -> dict:
        """
        Send a GET request.

        Parameters
        ----------
        path
            Request path.

        Returns
        -------
        dict
            Response payload.
        """
        return {}

    def post(self, path: str, body: dict) -> dict:
        """
        Send a POST request.

        Parameters
        ----------
        path
            Request path.
        body
            Request body.

        Returns
        -------
        dict
            Response payload.
        """
        return {}

    def put(self, path: str, body: dict) -> dict:
        """
        Send a PUT request.

        Parameters
        ----------
        path
            Request path.
        body
            Request body.

        Returns
        -------
        dict
            Response payload.
        """
        return {}

    def delete(self, path: str) -> bool:
        """
        Send a DELETE request.

        Parameters
        ----------
        path
            Request path.

        Returns
        -------
        bool
            True if successful.
        """
        return True

    def patch(self, path: str, body: dict) -> dict:
        """
        Send a PATCH request.

        Parameters
        ----------
        path
            Request path.
        body
            Partial update payload.

        Returns
        -------
        dict
            Response payload.
        """
        return {}

    def head(self, path: str) -> dict:
        """
        Send a HEAD request.

        Parameters
        ----------
        path
            Request path.

        Returns
        -------
        dict
            Response headers.
        """
        return {}

    def options(self, path: str) -> list:
        """
        Send an OPTIONS request.

        Parameters
        ----------
        path
            Request path.

        Returns
        -------
        list
            Allowed methods.
        """
        return []

    def close(self) -> None:
        """Close the client connection."""
        pass


class FullClient:
    """
    A client with 12 methods (gets split since 12 > 10).

    Parameters
    ----------
    host
        The server hostname.
    port
        The server port.
    """

    def __init__(self, host: str, port: int = 443):
        self.host = host
        self.port = port

    def get(self, path: str) -> dict:
        """
        Send a GET request.

        Parameters
        ----------
        path
            Request path.

        Returns
        -------
        dict
            Response payload.
        """
        return {}

    def post(self, path: str, body: dict) -> dict:
        """
        Send a POST request.

        Parameters
        ----------
        path
            Request path.
        body
            Request body.

        Returns
        -------
        dict
            Response payload.
        """
        return {}

    def put(self, path: str, body: dict) -> dict:
        """
        Send a PUT request.

        Parameters
        ----------
        path
            Request path.
        body
            Request body.

        Returns
        -------
        dict
            Response payload.
        """
        return {}

    def delete(self, path: str) -> bool:
        """
        Send a DELETE request.

        Parameters
        ----------
        path
            Request path.

        Returns
        -------
        bool
            True if successful.
        """
        return True

    def patch(self, path: str, body: dict) -> dict:
        """
        Send a PATCH request.

        Parameters
        ----------
        path
            Request path.
        body
            Partial update payload.

        Returns
        -------
        dict
            Response payload.
        """
        return {}

    def head(self, path: str) -> dict:
        """
        Send a HEAD request.

        Parameters
        ----------
        path
            Request path.

        Returns
        -------
        dict
            Response headers.
        """
        return {}

    def options(self, path: str) -> list:
        """
        Send an OPTIONS request.

        Parameters
        ----------
        path
            Request path.

        Returns
        -------
        list
            Allowed methods.
        """
        return []

    def connect(self) -> None:
        """Establish the connection."""
        pass

    def disconnect(self) -> None:
        """Terminate the connection."""
        pass

    def ping(self) -> float:
        """
        Measure round-trip latency.

        Returns
        -------
        float
            Latency in milliseconds.
        """
        return 0.0

    def authenticate(self, token: str) -> bool:
        """
        Authenticate with the server.

        Parameters
        ----------
        token
            Bearer token.

        Returns
        -------
        bool
            True if authenticated.
        """
        return True

    def refresh_token(self) -> str:
        """
        Refresh the authentication token.

        Returns
        -------
        str
            New token value.
        """
        return "new-token"


def connect(host: str, port: int = 443) -> FullClient:
    """
    Create and connect a client.

    Parameters
    ----------
    host
        Server hostname.
    port
        Server port.

    Returns
    -------
    FullClient
        Connected client instance.
    """
    client = FullClient(host, port)
    client.connect()
    return client
๐Ÿ“„ README.md
# gdtest-inline-threshold

Package testing `inline_methods: 10`. CompactClient (8 methods)
stays inline while FullClient (12 methods) gets split to
separate pages.
๐Ÿ“„ great-docs.yml
inline_methods: 10