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

Function test_run_command_validation_no_input

src/commands/run.rs:112–136  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110
111 #[tokio::test]
112 async fn test_run_command_validation_no_input() {
113 use crate::test_utils::TestGitRepository;
114
115 let test_repo = TestGitRepository::new().unwrap();
116 test_repo.init_with_commit().unwrap();
117
118 let cmd = RunCommand {
119 task_args: TaskArgs {
120 name: Some("test".to_string()),
121 r#type: "generic".to_string(),
122 repo: Some(test_repo.path().to_string_lossy().to_string()),
123 ..Default::default()
124 },
125 docker_client_override: mock_docker_client(),
126 };
127
128 let ctx = create_test_context();
129 let result = cmd.execute(&ctx).await;
130 assert!(result.is_err());
131 let err_msg = result.unwrap_err().to_string();
132 assert!(
133 err_msg.contains("Either prompt or prompt file must be provided, or use edit mode"),
134 "Expected validation error, but got: {err_msg}"
135 );
136 }
137
138 #[tokio::test]
139 async fn test_run_command_template_without_prompt() {

Callers

nothing calls this directly

Calls 5

init_with_commitMethod · 0.80
pathMethod · 0.80
mock_docker_clientFunction · 0.70
create_test_contextFunction · 0.70
executeMethod · 0.45

Tested by

no test coverage detected