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

Function test_add_command_validation_no_input

src/commands/add.rs:161–181  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

159
160 #[tokio::test]
161 async fn test_add_command_validation_no_input() {
162 let cmd = AddCommand {
163 task_args: TaskArgs {
164 name: Some("test".to_string()),
165 r#type: "generic".to_string(),
166 repo: Some(".".to_string()),
167 ..Default::default()
168 },
169 parent_id: None,
170 wait: false,
171 };
172
173 let ctx = create_test_context();
174 let result = cmd.execute(&ctx).await;
175 assert!(result.is_err());
176 let err_msg = result.unwrap_err().to_string();
177 assert!(
178 err_msg.contains("Either prompt or prompt file must be provided, or use edit mode"),
179 "Expected validation error, but got: {err_msg}"
180 );
181 }
182
183 #[tokio::test]
184 async fn test_add_command_invalid_task_type() {

Callers

nothing calls this directly

Calls 2

create_test_contextFunction · 0.70
executeMethod · 0.45

Tested by

no test coverage detected