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

Source from the content-addressed store, hash-verified

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