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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

convert_remote_errorFunction · 0.70

Tested by

no test coverage detected