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