Skip to content

aea.test_tools.mocks

This module contains mocking utils testing purposes.

AnyStringWith Objects

class AnyStringWith(str)

Helper class to assert calls of mocked method with string arguments.

It will use string inclusion as equality comparator.

__eq__

def __eq__(other: Any) -> bool

Check equality.

RegexComparator Objects

class RegexComparator(str)

Helper class to assert calls of mocked method with string arguments.

It will use regex matching as equality comparator.

__eq__

def __eq__(other: Any) -> bool

Check equality.

ctx_mock_Popen

@contextmanager
def ctx_mock_Popen() -> Generator

Mock subprocess.Popen.

Act as context manager.

:yield: mock generator.