unitelabs.bus.testing.fixtures
Functions
create_mock_connection(
- protocol_factory : typing.Callable[..., asyncio.Protocol],
- stubs : typing.Optional[list[Stub]],
- **kwargs
Parameters
- Name
protocol_factory
- Type
- typing.Callable[..., asyncio.Protocol]
- Default
- Description
- Name
stubs
- Type
- typing.Optional[list[Stub]]
- Default
- = None
- Description
- Name
**kwargs
- Type
- Default
- = {}
- Description
Response
- Type
- typing.Tuple[Transport, asyncio.Protocol]
- Description
@pytest.fixture
mock_factory(event_loop) -> TransportFactoryReturns `create_mock_connection` function that uses `pytest-asyncio` event-loop fixture to ensure no global loop exists.
Parameters
- Name
event_loop
- Type
- Default
- Description
Response
- Type
- TransportFactory
- Description
@pytest.fixture
serial_device() -> typing.AsyncGenerator[SerialDeviceMock, None]Response
- Type
- typing.AsyncGenerator[SerialDeviceMock, None]
- Description