()
| 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() { |
nothing calls this directly
no test coverage detected