()
| 200 | #[allow(invalid_from_utf8)] |
| 201 | #[tokio::test] |
| 202 | async fn test_clouddrive_get_invalid_utf8() { |
| 203 | const BAD_UTF8: &[u8] = &[0x00, 0xc3, 0x28]; |
| 204 | assert!(str::from_utf8(BAD_UTF8).is_err()); |
| 205 | |
| 206 | let service = Rc::from(RefCell::from(MockService::default())); |
| 207 | service.borrow_mut().do_login().await; |
| 208 | let drive = CloudDrive::new(service.clone(), "the-user"); |
| 209 | |
| 210 | service.borrow_mut().add_mock_get_file("the-user", "the-filename", Ok(BAD_UTF8)); |
| 211 | let result = drive.get("the-filename").await.unwrap(); |
| 212 | assert_eq!(BAD_UTF8, result); |
| 213 | |
| 214 | service.take().verify_all_used(); |
| 215 | } |
| 216 | |
| 217 | #[tokio::test] |
| 218 | async fn test_clouddrive_get_acls() { |
nothing calls this directly
no test coverage detected