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

Source from the content-addressed store, hash-verified

717 #[test]
718 #[serial]
719 fn test_run_with_explicit_from() {
720 use tempfile::tempdir;
721
722 let _guard = DirGuard::new();
723 let temp = tempdir().unwrap();
724 let repo_path = temp.path();
725
726 // Initialize a repository and create a source view
727 {
728 let mut repo = Repository::init(repo_path).unwrap();
729 repo.create_view("source-view").unwrap();
730 }
731
732 std::env::set_current_dir(repo_path).unwrap();
733
734 // Create a view explicitly forked from source-view
735 let cmd = New::with_name("forked-view").with_from("source-view");
736 let result = cmd.run();
737 assert!(result.is_ok());
738
739 // Verify the view exists
740 let repo = Repository::open(repo_path).unwrap();
741 assert!(repo.view_exists("forked-view").unwrap());
742 }
743
744 #[test]
745 #[serial]

Callers

nothing calls this directly

Calls 5

unwrapMethod · 0.45
pathMethod · 0.45
create_viewMethod · 0.45
with_fromMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected