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

Function test_basic_vector_operations

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

Source from the content-addressed store, hash-verified

93
94#[tokio::test]
95async fn test_basic_vector_operations() {
96 let result = setup_with_timeout().await;
97 assert!(result.is_ok(), "Setup timed out");
98 let (service, _context, collection_id) = result.unwrap();
99
100 let create_result = timeout(Duration::from_secs(5), async {
101 let create_req = CreateVectorRequest {
102 collection_id: collection_id.clone(),
103 vector: Some(Vector {
104 id: 1,
105 values: vec![0.1, 0.2, 0.3, 0.4],
106 }),
107 };
108 service.create_vector(Request::new(create_req)).await
109 })
110 .await;
111
112 assert!(create_result.is_ok(), "Create operation timed out");
113 let create_response = create_result.unwrap().unwrap();
114 assert_eq!(create_response.get_ref().id, 1);
115
116 cleanup();
117}
118
119#[tokio::test]
120async fn test_vector_update() {

Callers

nothing calls this directly

Calls 3

setup_with_timeoutFunction · 0.85
cleanupFunction · 0.85
cloneMethod · 0.80

Tested by

no test coverage detected