2525 DataCollectorConfiguration ,
2626)
2727
28+ from utils .checks import InvalidConfigurationError
29+
2830
2931def test_service_configuration_constructor () -> None :
3032 """Test the ServiceConfiguration constructor."""
@@ -58,7 +60,8 @@ def test_service_configuration_workers_value() -> None:
5860def test_llama_stack_configuration_constructor () -> None :
5961 """Test the LLamaStackConfiguration constructor."""
6062 llama_stack_configuration = LlamaStackConfiguration (
61- use_as_library_client = True , library_client_config_path = "foo"
63+ use_as_library_client = True ,
64+ library_client_config_path = "tests/configuration/run.yaml" ,
6265 )
6366 assert llama_stack_configuration is not None
6467
@@ -76,6 +79,18 @@ def test_llama_stack_configuration_constructor() -> None:
7679 assert llama_stack_configuration is not None
7780
7881
82+ def test_llama_stack_configuration_no_run_yaml () -> None :
83+ """Test the LLamaStackConfiguration constructor when run.yaml file is not a file."""
84+ with pytest .raises (
85+ InvalidConfigurationError ,
86+ match = "Llama Stack configuration file 'not a file' is not a file" ,
87+ ):
88+ LlamaStackConfiguration (
89+ use_as_library_client = True ,
90+ library_client_config_path = "not a file" ,
91+ )
92+
93+
7994def test_llama_stack_wrong_configuration_constructor_no_url () -> None :
8095 """Test the LLamaStackConfiguration constructor."""
8196 with pytest .raises (
@@ -298,7 +313,8 @@ def test_configuration_empty_mcp_servers() -> None:
298313 name = "test_name" ,
299314 service = ServiceConfiguration (),
300315 llama_stack = LlamaStackConfiguration (
301- use_as_library_client = True , library_client_config_path = "foo"
316+ use_as_library_client = True ,
317+ library_client_config_path = "tests/configuration/run.yaml" ,
302318 ),
303319 user_data_collection = UserDataCollection (
304320 feedback_disabled = True , feedback_storage = None
@@ -319,7 +335,8 @@ def test_configuration_single_mcp_server() -> None:
319335 name = "test_name" ,
320336 service = ServiceConfiguration (),
321337 llama_stack = LlamaStackConfiguration (
322- use_as_library_client = True , library_client_config_path = "foo"
338+ use_as_library_client = True ,
339+ library_client_config_path = "tests/configuration/run.yaml" ,
323340 ),
324341 user_data_collection = UserDataCollection (
325342 feedback_disabled = True , feedback_storage = None
@@ -346,7 +363,8 @@ def test_configuration_multiple_mcp_servers() -> None:
346363 name = "test_name" ,
347364 service = ServiceConfiguration (),
348365 llama_stack = LlamaStackConfiguration (
349- use_as_library_client = True , library_client_config_path = "foo"
366+ use_as_library_client = True ,
367+ library_client_config_path = "tests/configuration/run.yaml" ,
350368 ),
351369 user_data_collection = UserDataCollection (
352370 feedback_disabled = True , feedback_storage = None
@@ -368,7 +386,8 @@ def test_dump_configuration(tmp_path) -> None:
368386 name = "test_name" ,
369387 service = ServiceConfiguration (),
370388 llama_stack = LlamaStackConfiguration (
371- use_as_library_client = True , library_client_config_path = "foo"
389+ use_as_library_client = True ,
390+ library_client_config_path = "tests/configuration/run.yaml" ,
372391 ),
373392 user_data_collection = UserDataCollection (
374393 feedback_disabled = True , feedback_storage = None
@@ -413,7 +432,7 @@ def test_dump_configuration(tmp_path) -> None:
413432 "url" : None ,
414433 "api_key" : None ,
415434 "use_as_library_client" : True ,
416- "library_client_config_path" : "foo " ,
435+ "library_client_config_path" : "tests/configuration/run.yaml " ,
417436 },
418437 "user_data_collection" : {
419438 "feedback_disabled" : True ,
@@ -450,7 +469,8 @@ def test_dump_configuration_with_one_mcp_server(tmp_path) -> None:
450469 name = "test_name" ,
451470 service = ServiceConfiguration (),
452471 llama_stack = LlamaStackConfiguration (
453- use_as_library_client = True , library_client_config_path = "foo"
472+ use_as_library_client = True ,
473+ library_client_config_path = "tests/configuration/run.yaml" ,
454474 ),
455475 user_data_collection = UserDataCollection (
456476 feedback_disabled = True , feedback_storage = None
@@ -490,7 +510,7 @@ def test_dump_configuration_with_one_mcp_server(tmp_path) -> None:
490510 "url" : None ,
491511 "api_key" : None ,
492512 "use_as_library_client" : True ,
493- "library_client_config_path" : "foo " ,
513+ "library_client_config_path" : "tests/configuration/run.yaml " ,
494514 },
495515 "user_data_collection" : {
496516 "feedback_disabled" : True ,
@@ -535,7 +555,8 @@ def test_dump_configuration_with_more_mcp_servers(tmp_path) -> None:
535555 name = "test_name" ,
536556 service = ServiceConfiguration (),
537557 llama_stack = LlamaStackConfiguration (
538- use_as_library_client = True , library_client_config_path = "foo"
558+ use_as_library_client = True ,
559+ library_client_config_path = "tests/configuration/run.yaml" ,
539560 ),
540561 user_data_collection = UserDataCollection (
541562 feedback_disabled = True , feedback_storage = None
@@ -581,7 +602,7 @@ def test_dump_configuration_with_more_mcp_servers(tmp_path) -> None:
581602 "url" : None ,
582603 "api_key" : None ,
583604 "use_as_library_client" : True ,
584- "library_client_config_path" : "foo " ,
605+ "library_client_config_path" : "tests/configuration/run.yaml " ,
585606 },
586607 "user_data_collection" : {
587608 "feedback_disabled" : True ,
0 commit comments