"""Module with default entities for tests from Python packages."""

from asteex.runpackage.value import ValueStorage
from asteex.runpackage.fixture import FixtureStorage, ProducerFixtureDecorator
from asteex.runpackage.case import CaseStorage, DelegateCaseDecorator


_VALUE_STORAGE = ValueStorage()


def get_value_storage():
    """Get the default storage for static values.

    :returns: :class:`ValueStorage <asteex.runpackage.value.ValueStorage>`
    """
    return _VALUE_STORAGE


_FIXTURE_STORAGE = FixtureStorage()


def get_fixture_storage():
    """Get the default storage for fixtures.

    :returns: :class:`FixtureStorage <asteex.runpackage.fixture.FixtureStorage>`
    """
    return _FIXTURE_STORAGE


_CASE_STORAGE = CaseStorage()


def get_case_storage():
    """Get the default storage for test cases.

    :returns: :class:`CaseStorage <asteex.runpackage.case.CaseStorage>`
    """
    return _CASE_STORAGE


def producer_fixture():
    """Factory for decorators to create producer fixtures.

    :returns: :class:`ProducerFixtureDecorator <asteex.runpackage.fixture.ProducerFixtureDecorator>`
    """
    return ProducerFixtureDecorator().add_storages([get_fixture_storage()])


def delegate_case():
    """Factory for decorators to create delegate cases.

    :returns: :class:`DelegateCaseDecorator <asteex.runpackage.case.DelegateCaseDecorator>`
    """
    return DelegateCaseDecorator().add_storages([get_case_storage()])
