aea.test_
tools.test_
protocol
This module contains test case classes based on pytest for AEA protocol testing.
BaseProtocolMessagesTestCase Objects
class BaseProtocolMessagesTestCase(ABC)
Base class to test messages for the protocol.
MESSAGE_
CLASS
@property
@abstractmethod
def MESSAGE_CLASS() -> Type[Message]
Override this property in a subclass.
perform_
message_
test
def perform_message_test(msg: Message) -> None
Test message encode/decode.
test_
messages_
ok
def test_messages_ok() -> None
Run messages are ok for encode and decode.
test_
messages_
inconsistent
def test_messages_inconsistent() -> None
Run messages are inconsistent.
test_
messages_
fail_
to_
encode_
decode
def test_messages_fail_to_encode_decode() -> None
Run messages are failing to encode and decode.
build_
messages
@abstractmethod
def build_messages() -> List[Message]
Build the messages to be used for testing.
build_
inconsistent
@abstractmethod
def build_inconsistent() -> List[Message]
Build inconsistent messages to be used for testing.
BaseProtocolDialoguesTestCase Objects
class BaseProtocolDialoguesTestCase(ABC)
Base class to test message construction for the protocol.
MESSAGE_
CLASS
@property
@abstractmethod
def MESSAGE_CLASS() -> Type[Message]
Override this property in a subclass.
DIALOGUE_
CLASS
@property
@abstractmethod
def DIALOGUE_CLASS() -> Type[Dialogue]
Override this property in a subclass.
DIALOGUES_
CLASS
@property
@abstractmethod
def DIALOGUES_CLASS() -> Type[Dialogues]
Override this property in a subclass.
ROLE_
FOR_
THE_
FIRST_
MESSAGE
@property
@abstractmethod
def ROLE_FOR_THE_FIRST_MESSAGE() -> Dialogue.Role
Override this property in a subclass.
role_
from_
first_
message
def role_from_first_message(message: Message,
receiver_address: Address) -> Dialogue.Role
Infer the role of the agent from an incoming/outgoing first message
Arguments:
message
: an incoming/outgoing first messagereceiver_address
: the address of the receiving agent
Returns:
The role of the agent
make_
dialogues_
class
def make_dialogues_class() -> Type[Dialogues]
Make dialogues class with specific role.
make_
message_
content
@abstractmethod
def make_message_content() -> dict
Make a dict with message contruction content for dialogues.create.
test_
dialogues
def test_dialogues() -> None
Test dialogues.