request.tests.test_request_context

Unit tests for the BaseRequestContext class.

Classes

TestRequestContext

Test cases for the BaseRequestContext class.

Module Contents

class request.tests.test_request_context.TestRequestContext[source]

Test cases for the BaseRequestContext class.

test_init_with_defaults()[source]

Test that BaseRequestContext initializes with all None values by default.

test_init_with_values()[source]

Test that BaseRequestContext can be initialized with specific values.

test_to_dict()[source]

Test that to_dict returns a dictionary representation of the context.

test_to_dict_with_complex_objects()[source]

Test to_dict with complex objects like mocks.

test_clear()[source]

Test that clear() resets all attributes to None.

test_all_field_types()[source]

Test that all field types can be set and retrieved correctly.

test_parsed_message_with_pki_message()[source]

Test that parsed_message can hold a PKIMessage object.

test_dataclass_immutability_after_creation()[source]

Test that fields can be modified after creation (dataclass is mutable).

test_field_count()[source]

Test that the expected number of fields are present in BaseRequestContext.

test_to_dict_after_clear()[source]

Test that to_dict works correctly after clear().