()
| 953 | |
| 954 | #[test] |
| 955 | fn test_convert_view_not_found() { |
| 956 | // The server returns 404 both for a genuinely-missing view and for a |
| 957 | // private one the caller can't see. On a push (a write that needs |
| 958 | // auth) the message must name the view *and* explain that this may be |
| 959 | // an auth/authorization problem, with the remedy to run identity |
| 960 | // register — not the misleading "view not found". |
| 961 | let err = RemoteError::view_not_found("main"); |
| 962 | let cli_err = convert_remote_error(err, "http://example.com"); |
| 963 | |
| 964 | match cli_err { |
| 965 | CliError::RemoteError { message, .. } => { |
| 966 | let lower = message.to_lowercase(); |
| 967 | assert!(message.contains("main")); |
| 968 | assert!(message.contains("not found")); |
| 969 | assert!(lower.contains("authenticated") || lower.contains("authorized")); |
| 970 | assert!(message.contains("atomic identity register")); |
| 971 | } |
| 972 | _ => panic!("Expected RemoteError"), |
| 973 | } |
| 974 | } |
| 975 | |
| 976 | #[test] |
| 977 | fn test_convert_missing_deps() { |
nothing calls this directly
no test coverage detected