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

Function test_clouddrive_get

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

Source from the content-addressed store, hash-verified

169
170 #[tokio::test]
171 async fn test_clouddrive_get() {
172 let service = Rc::from(RefCell::from(MockService::default()));
173 service.borrow_mut().do_login().await;
174 let drive = CloudDrive::new(service.clone(), "the-user");
175
176 service.borrow_mut().add_mock_get_file(
177 "the-user",
178 "the-filename",
179 Ok(b"some content".to_owned()),
180 );
181 let result = drive.get("the-filename").await.unwrap();
182 assert_eq!("some content".as_bytes(), result);
183
184 service.take().verify_all_used();
185 }
186
187 #[tokio::test]
188 async fn test_clouddrive_get_no_content() {

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