Orchestrata Ultimate › Tests › Reference › postman › test_envelope_handler

Tests reference — tests/postman/test_envelope_handler.py

Module of tests/postman, split out because the directory page would be too large.

Prose pending.

tests/postman/test_envelope_handler.py

source · 63 tests · 721 lines

Comprehensive tests for EnvelopeHandler class.

Covers: postman.constants, postman.envelope, postman.exceptions, postman.types

Kind Name Line Description
class TestEnvelopeHandlerCreate 41 Tests for EnvelopeHandler.create() method.
method TestEnvelopeHandlerCreate.test_create_with_minimal_params 48 Test creating envelope with only required parameters.
method TestEnvelopeHandlerCreate.test_create_with_all_params 62 Test creating envelope with all parameters specified.
method TestEnvelopeHandlerCreate.test_create_with_topic_recipient 80 Test creating envelope with topic as recipient.
method TestEnvelopeHandlerCreate.test_create_with_all_content_types 95 Test creating envelopes with all valid content types.
method TestEnvelopeHandlerCreate.test_create_with_all_priorities 103 Test creating envelopes with all valid priority levels.
method TestEnvelopeHandlerCreate.test_create_with_edge_case_ttl_values 110 Test creating envelopes with edge case TTL values.
method TestEnvelopeHandlerCreate.test_create_empty_sender_error 122 Test create() raises error for empty sender.
method TestEnvelopeHandlerCreate.test_create_whitespace_sender_error 127 Test create() raises error for whitespace-only sender.
method TestEnvelopeHandlerCreate.test_create_invalid_sender_patterns 142 Test create() raises error for invalid sender patterns.
method TestEnvelopeHandlerCreate.test_create_empty_recipient_error 147 Test create() raises error for empty recipient.
method TestEnvelopeHandlerCreate.test_create_whitespace_recipient_error 152 Test create() raises error for whitespace-only recipient.
method TestEnvelopeHandlerCreate.test_create_invalid_content_type_error 157 Test create() raises error for invalid content type.
method TestEnvelopeHandlerCreate.test_create_invalid_priority_too_low 164 Test create() raises error for priority below 0.
method TestEnvelopeHandlerCreate.test_create_invalid_priority_too_high 169 Test create() raises error for priority above 4.
method TestEnvelopeHandlerCreate.test_create_invalid_ttl_zero 174 Test create() raises error for zero TTL.
method TestEnvelopeHandlerCreate.test_create_invalid_ttl_negative 179 Test create() raises error for negative TTL.
method TestEnvelopeHandlerCreate.test_create_invalid_ttl_exceeds_max 184 Test create() raises error for TTL exceeding 24 hours.
class TestEnvelopeHandlerValidate 190 Tests for EnvelopeHandler.validate() method.
method TestEnvelopeHandlerValidate.test_validate_valid_envelope 197 Test validate() returns True for valid envelope.
method TestEnvelopeHandlerValidate.test_validate_valid_envelope_with_all_fields 206 Test validate() returns True for envelope with all fields.
method TestEnvelopeHandlerValidate.test_validate_invalid_message_id 222 Test validate() detects invalid message_id.
method TestEnvelopeHandlerValidate.test_validate_empty_sender 236 Test validate() detects empty sender.
method TestEnvelopeHandlerValidate.test_validate_invalid_sender_pattern 245 Test validate() detects invalid sender pattern.
method TestEnvelopeHandlerValidate.test_validate_empty_recipient 256 Test validate() detects empty recipient.
method TestEnvelopeHandlerValidate.test_validate_invalid_recipient_special_chars 270 Test validate() detects recipient with invalid special characters.
method TestEnvelopeHandlerValidate.test_validate_content_type_not_on_envelope 282 Test validate() does not check content_type (it belongs to MessagePayload).
method TestEnvelopeHandlerValidate.test_validate_zero_ttl 296 Test validate() detects zero TTL.
method TestEnvelopeHandlerValidate.test_validate_negative_ttl 310 Test validate() detects negative TTL.
method TestEnvelopeHandlerValidate.test_validate_ttl_exceeds_max 324 Test validate() detects TTL exceeding maximum.
method TestEnvelopeHandlerValidate.test_validate_missing_timezone 338 Test validate() detects timestamp without timezone.
method TestEnvelopeHandlerValidate.test_validate_invalid_priority 351 Test validate() detects invalid priority value.
method TestEnvelopeHandlerValidate.test_validate_invalid_message_type 368 Test validate() detects invalid message_type.
class TestEnvelopeHandlerSerialization 386 Tests for EnvelopeHandler.serialize() and deserialize() methods.
method TestEnvelopeHandlerSerialization.test_serialize_deserialize_roundtrip 393 Test serialize() and deserialize() roundtrip.
method TestEnvelopeHandlerSerialization.test_serialize_deserialize_with_optional_fields 414 Test serialize/deserialize with all optional fields.
method TestEnvelopeHandlerSerialization.test_serialize_produces_bytes 429 Test serialize() returns bytes.
method TestEnvelopeHandlerSerialization.test_serialize_produces_valid_json 437 Test serialize() produces valid JSON.
method TestEnvelopeHandlerSerialization.test_deserialize_invalid_json 448 Test deserialize() raises error for invalid JSON.
method TestEnvelopeHandlerSerialization.test_deserialize_missing_required_fields 455 Test deserialize() raises InvalidPayloadError when required fields are missing.
method TestEnvelopeHandlerSerialization.test_deserialize_wrong_field_types 472 Test deserialize() raises error for wrong field types.
method TestEnvelopeHandlerSerialization.test_deserialize_invalid_utf8 489 Test deserialize() raises error for invalid UTF-8.
class TestEnvelopeHandlerExpiry 497 Tests for EnvelopeHandler.is_expired() method.
method TestEnvelopeHandlerExpiry.test_is_expired_not_expired 504 Test is_expired() returns False for non-expired envelope.
method TestEnvelopeHandlerExpiry.test_is_expired_expired_envelope 512 Test is_expired() returns True for expired envelope.
method TestEnvelopeHandlerExpiry.test_is_expired_just_expired 524 Test is_expired() for envelope that just expired.
method TestEnvelopeHandlerExpiry.test_is_expired_about_to_expire 536 Test is_expired() for envelope about to expire.
class TestEnvelopeHandlerRoutingKey 549 Tests for EnvelopeHandler.get_routing_key() method.
method TestEnvelopeHandlerRoutingKey.test_get_routing_key_agent_id 556 Test get_routing_key() returns agent ID for agent recipient.
method TestEnvelopeHandlerRoutingKey.test_get_routing_key_topic 564 Test get_routing_key() returns topic for topic recipient.
method TestEnvelopeHandlerRoutingKey.test_get_routing_key_strips_whitespace 572 Test get_routing_key() strips whitespace from recipient.
method TestEnvelopeHandlerRoutingKey.test_get_routing_key_empty_recipient_error 583 Test get_routing_key() raises error for empty recipient.
method TestEnvelopeHandlerRoutingKey.test_get_routing_key_whitespace_recipient_error 594 Test get_routing_key() raises error for whitespace-only recipient.
class TestEnvelopeHandlerExtendTTL 609 Tests for EnvelopeHandler.extend_ttl() method.
method TestEnvelopeHandlerExtendTTL.test_extend_ttl_valid_extension 616 Test extend_ttl() creates new envelope with extended TTL.
method TestEnvelopeHandlerExtendTTL.test_extend_ttl_does_not_modify_original 627 Test extend_ttl() does not modify original envelope.
method TestEnvelopeHandlerExtendTTL.test_extend_ttl_to_maximum 641 Test extend_ttl() can extend to maximum allowed TTL.
method TestEnvelopeHandlerExtendTTL.test_extend_ttl_zero_extension_error 653 Test extend_ttl() raises error for zero extension.
method TestEnvelopeHandlerExtendTTL.test_extend_ttl_negative_extension_error 660 Test extend_ttl() raises error for negative extension.
method TestEnvelopeHandlerExtendTTL.test_extend_ttl_exceeds_maximum_error 667 Test extend_ttl() raises error when extended TTL exceeds maximum.
class TestEnvelopeHandlerValidateContentType 679 Tests for EnvelopeHandler.validate_content_type() method.
method TestEnvelopeHandlerValidateContentType.test_validate_content_type_json 686 Test validate_content_type() returns True for JSON.
method TestEnvelopeHandlerValidateContentType.test_validate_content_type_text 690 Test validate_content_type() returns True for text.
method TestEnvelopeHandlerValidateContentType.test_validate_content_type_binary 694 Test validate_content_type() returns True for binary.
method TestEnvelopeHandlerValidateContentType.test_validate_content_type_compressed 698 Test validate_content_type() returns True for compressed.
method TestEnvelopeHandlerValidateContentType.test_validate_content_type_invalid_xml 702 Test validate_content_type() returns False for XML.
method TestEnvelopeHandlerValidateContentType.test_validate_content_type_invalid_html 706 Test validate_content_type() returns False for HTML.
method TestEnvelopeHandlerValidateContentType.test_validate_content_type_invalid_pdf 710 Test validate_content_type() returns False for PDF.
method TestEnvelopeHandlerValidateContentType.test_validate_content_type_empty_string 714 Test validate_content_type() returns False for empty string.
method TestEnvelopeHandlerValidateContentType.test_validate_content_type_none 718 Test validate_content_type() returns False for None.