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

Source from the content-addressed store, hash-verified

835
836 #[test]
837 fn test_convert_repo_not_found() {
838 // A 404 for the repository/project on a push is ambiguous (the server
839 // masks private projects), so the message must point at auth rather
840 // than implying the project is simply absent.
841 let err = RemoteError::repo_not_found("http://example.com/repo");
842 let cli_err = convert_remote_error(err, "http://example.com/repo");
843
844 match cli_err {
845 CliError::RemoteError { message, .. } => {
846 let lower = message.to_lowercase();
847 assert!(message.contains("not found"));
848 // Mentions the authentication/authorization possibility.
849 assert!(lower.contains("authenticated") || lower.contains("authorized"));
850 // Points at the remedy.
851 assert!(message.contains("atomic identity register"));
852 }
853 _ => panic!("Expected RemoteError"),
854 }
855 }
856
857 #[test]
858 fn test_convert_view_not_found() {

Callers

nothing calls this directly

Calls 1

convert_remote_errorFunction · 0.70

Tested by

no test coverage detected