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

Function test_status_run_in_repository

atomic-cli/src/commands/status.rs:1026–1052  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1024 #[test]
1025 #[serial]
1026 fn test_status_run_in_repository() {
1027 let _guard = DirGuard::new();
1028
1029 let temp_dir = tempfile::tempdir().unwrap();
1030 let repo_path = temp_dir.path();
1031
1032 // Initialize a repository (takes only path, creates default view)
1033 // We need to drop the repository handle before running status to avoid
1034 // database lock conflicts (redb only allows one open handle at a time)
1035 {
1036 let repo_result = Repository::init(repo_path);
1037 assert!(
1038 repo_result.is_ok(),
1039 "Failed to init repository: {:?}",
1040 repo_result.err()
1041 );
1042 } // Repository dropped here, releasing database lock
1043
1044 // Change to repo directory
1045 std::env::set_current_dir(repo_path).unwrap();
1046
1047 let status = Status::new();
1048 let result = status.run();
1049
1050 // Should succeed
1051 assert!(result.is_ok(), "Status command failed: {:?}", result.err());
1052 }
1053
1054 #[test]
1055 #[serial]

Callers

nothing calls this directly

Calls 3

unwrapMethod · 0.45
pathMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected