()
| 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#" |
| 1557 | agent = "codex" |
| 1558 | stack = "python" |
| 1559 | memory_gb = 20.0 |
| 1560 | host_ports = [8080] |
| 1561 | setup = "RUN pip install custom-tool" |
| 1562 | |
| 1563 | [stack_config.python] |
| 1564 | setup = "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() { |
nothing calls this directly
no test coverage detected