Перейти к содержанию

TestConfig

Test Schema.

TestConfig dataclass

Конфигурация тестирования очередей задач.

Attributes:

Name Type Description
worker bool

Воркер.

broker bool

Брокер.

storage bool

Хранилище.

global_config bool

Глобальный конфиг.

plugins bool

Плагины.

Source code in src/qtasks/schemas/test.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
@dataclass
class TestConfig:
    """
    Конфигурация тестирования очередей задач.

    Attributes:
        worker (bool): Воркер.
        broker (bool): Брокер.
        storage (bool): Хранилище.
        global_config (bool): Глобальный конфиг.
        plugins (bool): Плагины.

    """

    __test__ = False

    worker: bool = False
    broker: bool = False
    storage: bool = False
    global_config: bool = False
    plugins: bool = False

    @classmethod
    def full(cls):
        """Создать полную конфигурацию тестирования."""
        return cls(
            worker=True, broker=True, storage=True, global_config=True, plugins=True
        )

    @classmethod
    def only_worker(cls, plugins: bool = False):
        """Создать конфигурацию тестирования только для воркера."""
        return cls(worker=True, plugins=plugins)

    @classmethod
    def only_broker(cls, plugins: bool = False):
        """Создать конфигурацию тестирования только для брокера."""
        return cls(broker=True, plugins=plugins)

    @classmethod
    def full_broker(cls):
        """Создать полную конфигурацию тестирования для брокера."""
        return cls(broker=True, storage=True, global_config=True, plugins=True)

full() classmethod

Создать полную конфигурацию тестирования.

Source code in src/qtasks/schemas/test.py
28
29
30
31
32
33
@classmethod
def full(cls):
    """Создать полную конфигурацию тестирования."""
    return cls(
        worker=True, broker=True, storage=True, global_config=True, plugins=True
    )

full_broker() classmethod

Создать полную конфигурацию тестирования для брокера.

Source code in src/qtasks/schemas/test.py
45
46
47
48
@classmethod
def full_broker(cls):
    """Создать полную конфигурацию тестирования для брокера."""
    return cls(broker=True, storage=True, global_config=True, plugins=True)

only_broker(plugins=False) classmethod

Создать конфигурацию тестирования только для брокера.

Source code in src/qtasks/schemas/test.py
40
41
42
43
@classmethod
def only_broker(cls, plugins: bool = False):
    """Создать конфигурацию тестирования только для брокера."""
    return cls(broker=True, plugins=plugins)

only_worker(plugins=False) classmethod

Создать конфигурацию тестирования только для воркера.

Source code in src/qtasks/schemas/test.py
35
36
37
38
@classmethod
def only_worker(cls, plugins: bool = False):
    """Создать конфигурацию тестирования только для воркера."""
    return cls(worker=True, plugins=plugins)