2929
3030
3131def test_service_configuration_constructor () -> None :
32- """Test the ServiceConfiguration constructor."""
32+ """
33+ Verify that the ServiceConfiguration constructor sets default
34+ values for all fields.
35+ """
3336 s = ServiceConfiguration ()
3437 assert s is not None
3538
@@ -58,7 +61,11 @@ def test_service_configuration_workers_value() -> None:
5861
5962
6063def test_llama_stack_configuration_constructor () -> None :
61- """Test the LLamaStackConfiguration constructor."""
64+ """
65+ Verify that the LlamaStackConfiguration constructor accepts
66+ valid combinations of parameters and creates instances
67+ successfully.
68+ """
6269 llama_stack_configuration = LlamaStackConfiguration (
6370 use_as_library_client = True ,
6471 library_client_config_path = "tests/configuration/run.yaml" ,
@@ -80,7 +87,11 @@ def test_llama_stack_configuration_constructor() -> None:
8087
8188
8289def test_llama_stack_configuration_no_run_yaml () -> None :
83- """Test the LLamaStackConfiguration constructor when run.yaml file is not a file."""
90+ """
91+ Verify that constructing a LlamaStackConfiguration with a
92+ non-existent or invalid library_client_config_path raises
93+ InvalidConfigurationError.
94+ """
8495 with pytest .raises (
8596 InvalidConfigurationError ,
8697 match = "Llama Stack configuration file 'not a file' is not a file" ,
@@ -92,7 +103,11 @@ def test_llama_stack_configuration_no_run_yaml() -> None:
92103
93104
94105def test_llama_stack_wrong_configuration_constructor_no_url () -> None :
95- """Test the LLamaStackConfiguration constructor."""
106+ """
107+ Verify that constructing a LlamaStackConfiguration without
108+ specifying either a URL or enabling library client mode raises
109+ a ValueError.
110+ """
96111 with pytest .raises (
97112 ValueError ,
98113 match = "LLama stack URL is not specified and library client mode is not specified" ,
@@ -308,7 +323,13 @@ def test_model_context_protocol_server_required_fields() -> None:
308323
309324
310325def test_configuration_empty_mcp_servers () -> None :
311- """Test Configuration with empty MCP servers list."""
326+ """
327+ Test that a Configuration object can be created with an empty
328+ list of MCP servers.
329+
330+ Verifies that the Configuration instance is constructed
331+ successfully and that the mcp_servers attribute is empty.
332+ """
312333 cfg = Configuration (
313334 name = "test_name" ,
314335 service = ServiceConfiguration (),
@@ -327,7 +348,10 @@ def test_configuration_empty_mcp_servers() -> None:
327348
328349
329350def test_configuration_single_mcp_server () -> None :
330- """Test Configuration with a single MCP server."""
351+ """
352+ Test that a Configuration object can be created with a single
353+ MCP server and verifies its properties.
354+ """
331355 mcp_server = ModelContextProtocolServer (
332356 name = "test-server" , url = "http://localhost:8080"
333357 )
@@ -351,7 +375,11 @@ def test_configuration_single_mcp_server() -> None:
351375
352376
353377def test_configuration_multiple_mcp_servers () -> None :
354- """Test Configuration with multiple MCP servers."""
378+ """
379+ Verify that the Configuration object correctly handles multiple
380+ ModelContextProtocolServer instances in its mcp_servers list,
381+ including custom provider IDs.
382+ """
355383 mcp_servers = [
356384 ModelContextProtocolServer (name = "server1" , url = "http://localhost:8080" ),
357385 ModelContextProtocolServer (
@@ -381,7 +409,11 @@ def test_configuration_multiple_mcp_servers() -> None:
381409
382410
383411def test_dump_configuration (tmp_path ) -> None :
384- """Test the ability to dump configuration."""
412+ """
413+ Test that the Configuration object can be serialized to a JSON
414+ file and that the resulting file contains all expected sections
415+ and values.
416+ """
385417 cfg = Configuration (
386418 name = "test_name" ,
387419 service = ServiceConfiguration (),
@@ -461,7 +493,14 @@ def test_dump_configuration(tmp_path) -> None:
461493
462494
463495def test_dump_configuration_with_one_mcp_server (tmp_path ) -> None :
464- """Test the ability to dump configuration with one MCP server configured."""
496+ """
497+ Verify that a configuration with a single MCP server can be
498+ serialized to JSON and that all expected fields and values are
499+ present in the output.
500+
501+ Parameters:
502+ tmp_path: Temporary directory path provided by pytest for file output.
503+ """
465504 mcp_servers = [
466505 ModelContextProtocolServer (name = "test-server" , url = "http://localhost:8080" ),
467506 ]
@@ -545,7 +584,15 @@ def test_dump_configuration_with_one_mcp_server(tmp_path) -> None:
545584
546585
547586def test_dump_configuration_with_more_mcp_servers (tmp_path ) -> None :
548- """Test the ability to dump configuration with more MCP servers configured."""
587+ """
588+ Test that a configuration with multiple MCP servers can be
589+ serialized to JSON and that all server entries are correctly
590+ included in the output.
591+
592+ Verifies that the dumped configuration file contains all
593+ expected fields and that each MCP server is present with the
594+ correct name, URL, and provider ID.
595+ """
549596 mcp_servers = [
550597 ModelContextProtocolServer (name = "test-server-1" , url = "http://localhost:8081" ),
551598 ModelContextProtocolServer (name = "test-server-2" , url = "http://localhost:8082" ),
0 commit comments