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:287–312  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

unwrapMethod · 0.45
pathMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected