MCPcopy Create free account
hub / github.com/dtormoen/tsk-tsk / test_load_project_config

Function test_load_project_config

src/context/tsk_config.rs:1551–1581  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1549
1550 #[test]
1551 fn test_load_project_config() {
1552 let temp_dir = tempfile::TempDir::new().unwrap();
1553 let project_root = temp_dir.path();
1554
1555 std::fs::create_dir_all(project_root.join(".tsk")).unwrap();
1556 let toml_content = r#"
1557agent = "codex"
1558stack = "python"
1559memory_gb = 20.0
1560host_ports = [8080]
1561setup = "RUN pip install custom-tool"
1562
1563[stack_config.python]
1564setup = "RUN pip install numpy"
1565"#;
1566 std::fs::write(project_root.join(".tsk/tsk.toml"), toml_content).unwrap();
1567
1568 let config = load_project_config(project_root).unwrap();
1569 assert_eq!(config.agent, Some("codex".to_string()));
1570 assert_eq!(config.stack, Some("python".to_string()));
1571 assert_eq!(config.memory_gb, Some(20.0));
1572 assert_eq!(config.host_ports, vec![8080]);
1573 assert_eq!(
1574 config.setup,
1575 Some("RUN pip install custom-tool".to_string())
1576 );
1577 assert_eq!(
1578 config.stack_config["python"].setup,
1579 Some("RUN pip install numpy".to_string())
1580 );
1581 }
1582
1583 #[test]
1584 fn test_load_project_config_missing() {

Callers

nothing calls this directly

Calls 2

load_project_configFunction · 0.85
pathMethod · 0.80

Tested by

no test coverage detected