MCPcopy Index your code
hub / github.com/endbasic/endbasic / test_clouddrive_get_invalid_utf8

Function test_clouddrive_get_invalid_utf8

client/src/drive.rs:202–215  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 4

add_mock_get_fileMethod · 0.80
verify_all_usedMethod · 0.80
do_loginMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected