@@ -28,7 +28,7 @@ def reset_asyncapi_state():
28
28
29
29
30
30
# Test message models
31
- class TestMessage (BaseModel ):
31
+ class SomeTestMessage (BaseModel ):
32
32
content : str
33
33
timestamp : int
34
34
@@ -103,31 +103,31 @@ def test_register_channel_operation(reset_asyncapi_state):
103
103
104
104
register_channel (address = "test/topic" , id = channel_id )
105
105
register_channel_operation (
106
- channel_id = channel_id , operation_type = operation_type , messages = [TestMessage ], operation_name = "test-operation"
106
+ channel_id = channel_id , operation_type = operation_type , messages = [SomeTestMessage ], operation_name = "test-operation"
107
107
)
108
108
109
109
schema = get_schema ()
110
110
assert "test-operation" in schema .operations
111
111
assert schema .operations ["test-operation" ].action == operation_type
112
112
assert schema .operations ["test-operation" ].channel .ref == f"#/channels/{ channel_id } "
113
- assert TestMessage .__name__ in schema .components .schemas
113
+ assert SomeTestMessage .__name__ in schema .components .schemas
114
114
115
115
116
116
def test_register_channel_operation_invalid_channel (reset_asyncapi_state ):
117
117
"""Test channel operation registration with invalid channel"""
118
118
with pytest .raises (ValueError , match = "Channel non-existent does not exist" ):
119
- register_channel_operation (channel_id = "non-existent" , operation_type = "receive" , messages = [TestMessage ])
119
+ register_channel_operation (channel_id = "non-existent" , operation_type = "receive" , messages = [SomeTestMessage ])
120
120
121
121
122
122
def test_multiple_messages_registration (reset_asyncapi_state ):
123
123
"""Test registration of multiple messages for an operation"""
124
124
channel_id = "test-channel"
125
125
126
126
register_channel (address = "test/topic" , id = channel_id )
127
- register_channel_operation (channel_id = channel_id , operation_type = "send" , messages = [TestMessage , AnotherTestMessage ])
127
+ register_channel_operation (channel_id = channel_id , operation_type = "send" , messages = [SomeTestMessage , AnotherTestMessage ])
128
128
129
129
schema = get_schema ()
130
- assert TestMessage .__name__ in schema .components .schemas
130
+ assert SomeTestMessage .__name__ in schema .components .schemas
131
131
assert AnotherTestMessage .__name__ in schema .components .schemas
132
- assert TestMessage .__name__ in schema .channels [channel_id ].messages
132
+ assert SomeTestMessage .__name__ in schema .channels [channel_id ].messages
133
133
assert AnotherTestMessage .__name__ in schema .channels [channel_id ].messages
0 commit comments