MCPcopy Create free account
hub / github.com/cosdata/cosdata / test_delete_vector

Function test_delete_vector

src/grpc/vectors/tests.rs:206–246  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

204
205#[tokio::test]
206async fn test_delete_vector() {
207 let result = setup_with_timeout().await;
208 assert!(result.is_ok(), "Setup timed out");
209 let (service, _context, collection_id) = result.unwrap();
210
211 timeout(Duration::from_secs(5), async {
212 let create_req = CreateVectorRequest {
213 collection_id: collection_id.clone(),
214 vector: Some(Vector {
215 id: 1,
216 values: vec![0.1, 0.2, 0.3, 0.4],
217 }),
218 };
219 service
220 .create_vector(Request::new(create_req))
221 .await
222 .unwrap();
223 })
224 .await
225 .unwrap();
226
227 let delete_result = timeout(Duration::from_secs(5), async {
228 let delete_req = DeleteVectorRequest {
229 collection_id,
230 vector_id: 1,
231 };
232 service.delete_vector(Request::new(delete_req)).await
233 })
234 .await;
235
236 assert!(
237 delete_result.is_err(),
238 "Delete operation should fail (Unimplemented)"
239 );
240 assert_eq!(
241 delete_result.unwrap_err().code(),
242 tonic::Code::Unimplemented
243 );
244
245 cleanup();
246}

Callers

nothing calls this directly

Calls 3

setup_with_timeoutFunction · 0.85
cleanupFunction · 0.85
cloneMethod · 0.80

Tested by

no test coverage detected