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

Source from the content-addressed store, hash-verified

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