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

Source from the content-addressed store, hash-verified

1838 #[test]
1839 #[file_serial]
1840 fn test_status_run_in_repository() {
1841 let _guard = DirGuard::new();
1842
1843 let temp_dir = tempfile::tempdir().unwrap();
1844 let repo_path = temp_dir.path();
1845
1846 // Initialize a repository (takes only path, creates default view)
1847 // We need to drop the repository handle before running status to avoid
1848 // database lock conflicts (redb only allows one open handle at a time)
1849 {
1850 let repo_result = Repository::init(repo_path);
1851 assert!(
1852 repo_result.is_ok(),
1853 "Failed to init repository: {:?}",
1854 repo_result.err()
1855 );
1856 } // Repository dropped here, releasing database lock
1857
1858 // Change to repo directory
1859 std::env::set_current_dir(repo_path).unwrap();
1860
1861 let status = Status::new();
1862 let result = status.run();
1863
1864 // Should succeed
1865 assert!(result.is_ok(), "Status command failed: {:?}", result.err());
1866 }
1867
1868 #[test]
1869 #[file_serial]

Callers

nothing calls this directly

Calls 4

initFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected