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

Function test_run_with_explicit_from

atomic-cli/src/commands/view/new.rs:798–821  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

796 #[test]
797 #[file_serial]
798 fn test_run_with_explicit_from() {
799 use tempfile::tempdir;
800
801 let _guard = DirGuard::new();
802 let temp = tempdir().unwrap();
803 let repo_path = temp.path();
804
805 // Initialize a repository and create a source view
806 {
807 let mut repo = Repository::init(repo_path).unwrap();
808 repo.create_view("source-view").unwrap();
809 }
810
811 std::env::set_current_dir(repo_path).unwrap();
812
813 // Create a view explicitly forked from source-view
814 let cmd = New::with_name("forked-view").with_from("source-view");
815 let result = cmd.run();
816 assert!(result.is_ok());
817
818 // Verify the view exists
819 let repo = Repository::open(repo_path).unwrap();
820 assert!(repo.view_exists("forked-view").unwrap());
821 }
822
823 #[test]
824 #[file_serial]

Callers

nothing calls this directly

Calls 7

openFunction · 0.85
initFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45
create_viewMethod · 0.45
with_fromMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected