MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_delete_nonexistent_view

Function test_delete_nonexistent_view

atomic-cli/src/commands/view/delete.rs:284–309  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

282 #[test]
283 #[serial]
284 fn test_delete_nonexistent_view() {
285 use tempfile::tempdir;
286
287 let _guard = DirGuard::new();
288 let temp = tempdir().unwrap();
289 let repo_path = temp.path();
290
291 // Initialize a repository and drop to release lock
292 {
293 let _repo = Repository::init(repo_path).unwrap();
294 }
295
296 // Change to the repo directory
297 std::env::set_current_dir(repo_path).unwrap();
298
299 // Try to delete a non-existent view
300 let cmd = Delete::with_name("nonexistent");
301 let result = cmd.run();
302 assert!(result.is_err());
303 match result.unwrap_err() {
304 CliError::ViewNotFound { name } => {
305 assert_eq!(name, "nonexistent");
306 }
307 other => panic!("Expected ViewNotFound, got: {:?}", other),
308 }
309 }
310
311 #[test]
312 #[serial]

Callers

nothing calls this directly

Calls 3

unwrapMethod · 0.45
pathMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected