()
| 45 | |
| 46 | const CACHEABLE_PUBLIC: &str = "max-age=86400, public"; |
| 47 | |
| 48 | #[test] |
| 49 | #[allow(clippy::default_constructed_unit_structs)] |
| 50 | fn test_errors() -> Result<()> { |
| 51 | // Testing the Debug, Default, and Clone traits for the error types |
| 52 | let br = BadRequest::default(); |
| 53 | assert_eq!(format!("{:?}", br.clone()), "BadRequest",); |
| 54 | assert_eq!( |
| 55 | br.to_string(), |
| 56 | "Request object is not cloneable. Are you passing a streaming body?" |
| 57 | .to_string(), |
| 58 | ); |
| 59 | |
| 60 | // Test HttpCacheError |
| 61 | let reqwest_err = HttpCacheError::cache("test cache error".to_string()); |
| 62 | assert!(format!("{:?}", reqwest_err).contains("Cache")); |
| 63 | assert_eq!( |
| 64 | reqwest_err.to_string(), |
| 65 | "Cache error: test cache error".to_string(), |
| 66 | ); |
| 67 | Ok(()) |
| 68 | } |
nothing calls this directly
no outgoing calls
no test coverage detected