messaging.test package¶
Submodules¶
messaging.test.test_apps module¶
-
class
messaging.test.test_apps.
TestMessagingConfig
(methodName='runTest')¶ Bases:
django.test.testcases.TestCase
-
setUp
()¶
-
test_ready
(*args, **keywargs)¶ Validate backends and message type registration has been done.
Parameters: - add_message_type – mock for adding message types
- add_message_backends – mock for adding messaging backends
-
messaging.test.test_backends module¶
-
class
messaging.test.test_backends.
DummyBackend
¶ Bases:
messaging.backends.backend.MessagingBackend
-
get_queue_size
()¶
-
receive_messages
(batch_size)¶
-
send_messages
(message)¶
-
-
class
messaging.test.test_backends.
TestAMQPBackend
(methodName='runTest')¶ Bases:
django.test.testcases.TestCase
-
setUp
()¶
-
test_false_result_during_receive_message_yield
(*args, **keywargs)¶ Validate message ack is not done with yield returns False in AMQP backend
-
test_valid_init
()¶ Validate initialization specific to AMQP backend is completed
-
test_valid_receive_messages
(*args, **keywargs)¶ Validate successful message retrieval via AMQP backend
-
test_valid_send_message
(*args, **keywargs)¶ Validate message is sent via the AMQP backend
-
test_valid_send_messages
(*args, **keywargs)¶ Validate message is sent via the AMQP backend
-
test_valid_single_batch_receive_message
(*args, **keywargs)¶ Validate successful message retrieval via AMQP backend of first 2 messages
-
-
class
messaging.test.test_backends.
TestBackendsFactory
(methodName='runTest')¶ Bases:
django.test.testcases.TestCase
-
setUp
()¶
-
test_add_message_backend
()¶ Validate add message backend functionality
-
test_get_message_backends
()¶ Validate listing behavior of backends from factory
-
test_successfully_get_message_backend
()¶ Validate successful retrieval of message backend from factory
-
test_unmatched_get_message_backend
()¶ Validate missing message backend behavior from factory
-
-
class
messaging.test.test_backends.
TestMessagingBackend
(methodName='runTest')¶ Bases:
django.test.testcases.TestCase
-
setUp
()¶
-
test_valid_init
(*args, **keywargs)¶ Validate correct initialization of backend internal properties
-
-
class
messaging.test.test_backends.
TestSQSBackend
(methodName='runTest')¶ Bases:
django.test.testcases.TestCase
-
setUp
()¶
-
test_exception_during_receive_messages
(*args, **keywargs)¶ Validate exception handling during message consumption from SQS backend
-
test_valid_init
(*args, **keywargs)¶ Validate initialization specific to SQS backend is completed
-
test_valid_multiple_send_messages
(*args, **keywargs)¶ Validate message is sent via the SQS backend
-
test_valid_receive_messages
(*args, **keywargs)¶ Validate successful message retrieval via SQS backend
-
test_valid_single_send_messages
(*args, **keywargs)¶ Validate message is sent via the SQS backend
-
messaging.test.test_manager module¶
-
class
messaging.test.test_manager.
TestCommandMessageManager
(methodName='runTest')¶ Bases:
django.test.testcases.TestCase
-
setUp
()¶
-
tearDown
()¶
-
test_failing_process_message
(*args, **keywargs)¶ Validate logic for a process message failing in process execution
-
test_missing_body_extract_command
()¶ Validate InvalidCommandMessage is raised when missing body key
-
test_missing_type_extract_command
()¶ Validate InvalidCommandMessage is raised when missing type key
-
test_no_message_send_downstream
(*args, **keywargs)¶ Validate send_message is not called when messages is empty
-
test_no_registered_type_extract_command
(*args, **keywargs)¶ Validate InvalidCommandMessage is raised when no type matches
-
test_process_message_exception
(*args, **keywargs)¶ Validate logic for a process message throwing an exception in process execution
-
test_receive_message
()¶ Validate the receive_message calls _process_message with each result
-
test_send_message
()¶ Validate that send_message composes dict with type and body keys for backend
-
test_send_message_no_serializer
()¶ Validate that send_message raises AttributeError when to_json is not available
-
test_send_messages_no_type
()¶ Validate that send_message raises AttributeError when message type is not available
-
test_successful_process_message
(*args, **keywargs)¶ Validate logic for a successful command process
-
test_successful_send_downstream
(*args, **keywargs)¶ Validate call of send_message for each downstream message
-
test_valid_extract_command
(*args, **keywargs)¶ Validate a successful _extract_command call instantiation of CommandMessage class from payload
-
messaging.test.test_manager_singleton module¶
-
class
messaging.test.test_manager_singleton.
TestSingletonCommandMessageManager
(methodName='runTest')¶ Bases:
django.test.testcases.TestCase
-
setUp
()¶
-
test_receive_message_execute_failure
(*args, **keywargs)¶ Exercise all exception code paths within receive_message
-
test_receive_message_invalid_message
(*args, **keywargs)¶ Exercise all exception code paths within receive_message
-
test_verify_singleton
(*args, **keywargs)¶ Validate that multiple instantiation attempts result in single instance
-
messaging.test.test_messages module¶
-
class
messaging.test.test_messages.
DummyMessage
¶ Bases:
messaging.messages.message.CommandMessage
-
execute
()¶
-
static
from_json
(message)¶
-
to_json
()¶
-
-
class
messaging.test.test_messages.
TestChainedCommandMessage
(methodName='runTest')¶ Bases:
django.test.testcases.TestCase
-
setUp
()¶
-
test_valid_execute
()¶ Validate message execution logic with downstream messages for echo command
-
test_valid_from_json
()¶ Validate instantiation of echo command message from json
-
test_valid_init
()¶ Validate correct initialization of messages internal properties
-
test_valid_to_json
()¶ Validate serialization of echo command message to json
-
-
class
messaging.test.test_messages.
TestCommandMessage
(methodName='runTest')¶ Bases:
django.test.testcases.TestCase
-
setUp
()¶
-
test_valid_init
()¶ Validate correct initialization of messages internal properties
-
-
class
messaging.test.test_messages.
TestEchoCommandMessage
(methodName='runTest')¶ Bases:
django.test.testcases.TestCase
-
setUp
()¶
-
test_valid_execute
()¶ Validate message execution logic with downstream messages for echo command
-
test_valid_from_json
()¶ Validate instantiation of echo command message from json
-
test_valid_init
()¶ Validate correct initialization of messages internal properties
-
test_valid_to_json
()¶ Validate serialization of echo command message to json
-
-
class
messaging.test.test_messages.
TestFailingCommandMessage
(methodName='runTest')¶ Bases:
django.test.testcases.TestCase
-
setUp
()¶
-
test_valid_execute
()¶ Validate message execution logic with downstream messages for echo command
-
test_valid_from_json
()¶ Validate instantiation of echo command message from json
-
test_valid_init
()¶ Validate correct initialization of messages internal properties
-
test_valid_to_json
()¶ Validate serialization of echo command message to json
-
-
class
messaging.test.test_messages.
TestMessagesFactory
(methodName='runTest')¶ Bases:
django.test.testcases.TestCase
-
setUp
()¶
-
test_add_message_type
()¶ Validate add message type functionality
-
test_get_message_backends
()¶ Validate listing behavior of types from factory
-
test_successfully_get_message_backend
()¶ Validate successful retrieval of message type from factory
-
test_unmatched_get_message_backend
()¶ Validate missing message type behavior of factory
-