@@ -196,157 +196,3 @@ def test_resolve_channel_address_without_binding_accepts_concrete_params():
196196
197197 # Verify the address was substituted with concrete value
198198 assert config .queue_name == "task.high"
199-
200-
201- def test_resolve_amqp_config_rejects_missing_parameters ():
202- """Resolver should validate all required parameters are provided."""
203- from asyncapi_python .kernel .document .channel import AddressParameter
204-
205- # Create channel with 2 required parameters
206- channel = create_test_channel (
207- address = "weather.{location}.{severity}" ,
208- binding = AmqpChannelBinding (type = "queue" ),
209- )
210- # Add parameter definitions to channel
211- channel = Channel (
212- key = channel .key ,
213- address = channel .address ,
214- title = channel .title ,
215- summary = channel .summary ,
216- description = channel .description ,
217- servers = channel .servers ,
218- messages = channel .messages ,
219- parameters = {
220- "location" : AddressParameter (
221- key = "location" ,
222- description = "Geographic location" ,
223- location = None ,
224- ),
225- "severity" : AddressParameter (
226- key = "severity" ,
227- description = "Alert severity" ,
228- location = None ,
229- ),
230- },
231- tags = channel .tags ,
232- external_docs = channel .external_docs ,
233- bindings = channel .bindings ,
234- )
235-
236- params : EndpointParams = {
237- "channel" : channel ,
238- "parameters" : {"location" : "NYC" }, # Missing severity
239- "op_bindings" : None ,
240- "is_reply" : False ,
241- }
242-
243- with pytest .raises (ValueError ) as exc_info :
244- resolve_amqp_config (params , "test_op" , "test_app" )
245-
246- error_msg = str (exc_info .value )
247- assert "Missing required parameters" in error_msg
248- assert "severity" in error_msg
249-
250-
251- def test_resolve_amqp_config_rejects_extra_parameters ():
252- """Resolver should reject extra parameters not defined in channel."""
253- from asyncapi_python .kernel .document .channel import AddressParameter
254-
255- # Create channel with 1 required parameter
256- channel = create_test_channel (
257- address = "weather.{location}" ,
258- binding = AmqpChannelBinding (type = "queue" ),
259- )
260- # Add parameter definition to channel
261- channel = Channel (
262- key = channel .key ,
263- address = channel .address ,
264- title = channel .title ,
265- summary = channel .summary ,
266- description = channel .description ,
267- servers = channel .servers ,
268- messages = channel .messages ,
269- parameters = {
270- "location" : AddressParameter (
271- key = "location" ,
272- description = "Geographic location" ,
273- location = None ,
274- ),
275- },
276- tags = channel .tags ,
277- external_docs = channel .external_docs ,
278- bindings = channel .bindings ,
279- )
280-
281- params : EndpointParams = {
282- "channel" : channel ,
283- "parameters" : {
284- "location" : "NYC" ,
285- "severity" : "high" , # Extra parameter
286- },
287- "op_bindings" : None ,
288- "is_reply" : False ,
289- }
290-
291- with pytest .raises (ValueError ) as exc_info :
292- resolve_amqp_config (params , "test_op" , "test_app" )
293-
294- error_msg = str (exc_info .value )
295- assert "Unexpected parameters" in error_msg
296- assert "severity" in error_msg
297-
298-
299- def test_resolve_amqp_config_routing_key_rejects_missing_parameters ():
300- """Routing key bindings should also validate all parameters are provided."""
301- from asyncapi_python .kernel .document .channel import AddressParameter
302-
303- # Create channel with routingKey binding
304- channel = create_test_channel (
305- address = "weather.{location}.{severity}" ,
306- binding = AmqpChannelBinding (
307- type = "routingKey" ,
308- exchange = AmqpExchange (
309- name = "weather_exchange" ,
310- type = AmqpExchangeType .TOPIC ,
311- ),
312- ),
313- )
314- # Add parameter definitions
315- channel = Channel (
316- key = channel .key ,
317- address = channel .address ,
318- title = channel .title ,
319- summary = channel .summary ,
320- description = channel .description ,
321- servers = channel .servers ,
322- messages = channel .messages ,
323- parameters = {
324- "location" : AddressParameter (
325- key = "location" ,
326- description = "Geographic location" ,
327- location = None ,
328- ),
329- "severity" : AddressParameter (
330- key = "severity" ,
331- description = "Alert severity" ,
332- location = None ,
333- ),
334- },
335- tags = channel .tags ,
336- external_docs = channel .external_docs ,
337- bindings = channel .bindings ,
338- )
339-
340- params : EndpointParams = {
341- "channel" : channel ,
342- "parameters" : {"location" : "NYC" }, # Missing severity
343- "op_bindings" : None ,
344- "is_reply" : False ,
345- }
346-
347- with pytest .raises (ValueError ) as exc_info :
348- resolve_amqp_config (params , "test_op" , "test_app" )
349-
350- error_msg = str (exc_info .value )
351- assert "Missing required parameters" in error_msg
352- assert "severity" in error_msg
0 commit comments