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

Function test_convert_repo_not_found

atomic-cli/src/commands/push/helpers.rs:628–646  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

626
627 #[test]
628 fn test_convert_repo_not_found() {
629 // A 404 for the repository/project on a push is ambiguous (the server
630 // masks private projects), so the message must point at auth rather
631 // than implying the project is simply absent.
632 let err = RemoteError::repo_not_found("http://example.com/repo");
633 let cli_err = convert_remote_error(err, "http://example.com/repo");
634
635 match cli_err {
636 CliError::RemoteError { message, .. } => {
637 let lower = message.to_lowercase();
638 assert!(message.contains("not found"));
639 // Mentions the authentication/authorization possibility.
640 assert!(lower.contains("authenticated") || lower.contains("authorized"));
641 // Points at the remedy.
642 assert!(message.contains("atomic identity register"));
643 }
644 _ => panic!("Expected RemoteError"),
645 }
646 }
647
648 #[test]
649 fn test_convert_view_not_found() {

Callers

nothing calls this directly

Calls 1

convert_remote_errorFunction · 0.70

Tested by

no test coverage detected