Skip to content

fixtures

frequenz.client.dispatch.test.fixtures ¤

Useful fixtures for testing.

Classes¤

Functions¤

frequenz.client.dispatch.test.fixtures.client ¤

client() -> FakeClient

Return a fake client.

Source code in frequenz/client/dispatch/test/fixtures.py
@fixture
def client() -> FakeClient:
    """Return a fake client."""
    return FakeClient()

frequenz.client.dispatch.test.fixtures.generator ¤

generator() -> DispatchGenerator

Return a dispatch generator.

Source code in frequenz/client/dispatch/test/fixtures.py
@fixture
def generator() -> DispatchGenerator:
    """Return a dispatch generator."""
    return DispatchGenerator()

frequenz.client.dispatch.test.fixtures.sample ¤

sample(generator: DispatchGenerator) -> Dispatch

Return a dispatch sample.

Source code in frequenz/client/dispatch/test/fixtures.py
@fixture
def sample(generator: DispatchGenerator) -> Dispatch:
    """Return a dispatch sample."""
    return generator.generate_dispatch()