From 7e47e7041785091260d74265eeba1fdf5f4d8992 Mon Sep 17 00:00:00 2001 From: Erica Wang Date: Wed, 7 Aug 2024 11:44:31 -0400 Subject: [PATCH] fix test case --- codegen/apis | 2 +- src/models/mod.rs | 16 +++++++++------- tests/integration_test_control.rs | 4 +++- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/codegen/apis b/codegen/apis index 062b114..4de4456 160000 --- a/codegen/apis +++ b/codegen/apis @@ -1 +1 @@ -Subproject commit 062b114b6d7b016de2b4d2b68c211a81b8689d1a +Subproject commit 4de44568f98556d29e8044c8146b572d2396cb05 diff --git a/src/models/mod.rs b/src/models/mod.rs index f33753b..c05b564 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -23,13 +23,15 @@ mod embedding; pub use self::embedding::Embedding; pub use crate::openapi::models::{ - serverless_spec::Cloud, CollectionList, CollectionModel, ConfigureIndexRequest, - ConfigureIndexRequestSpec, ConfigureIndexRequestSpecPod, CreateCollectionRequest, - DeletionProtection, EmbedRequestParameters, IndexModelSpec, IndexModelStatus, IndexSpec, - PodSpec, PodSpecMetadataConfig, ServerlessSpec, + index_model_status::State, serverless_spec::Cloud, CollectionList, CollectionModel, + ConfigureIndexRequest, ConfigureIndexRequestSpec, ConfigureIndexRequestSpecPod, + CreateCollectionRequest, DeletionProtection, EmbedRequestParameters, IndexModelSpec, + IndexModelStatus, IndexSpec, PodSpec, PodSpecMetadataConfig, ServerlessSpec, }; -pub use crate::protos::{DescribeIndexStatsResponse, FetchResponse, ListResponse, QueryResponse, SparseValues, - UpdateResponse, UpsertResponse, Vector}; +pub use crate::protos::{ + DescribeIndexStatsResponse, FetchResponse, ListResponse, QueryResponse, SparseValues, + UpdateResponse, UpsertResponse, Vector, +}; -pub use prost_types::{value::Kind as Kind, Struct as Metadata, Value}; \ No newline at end of file +pub use prost_types::{value::Kind, Struct as Metadata, Value}; diff --git a/tests/integration_test_control.rs b/tests/integration_test_control.rs index 89e51e9..1e5a0fb 100644 --- a/tests/integration_test_control.rs +++ b/tests/integration_test_control.rs @@ -395,7 +395,9 @@ async fn test_create_delete_collection() -> Result<(), PineconeError> { let index_name = &get_pod_index(); loop { if match pinecone.describe_index(index_name).await { - Ok(index) => index.status.ready, + Ok(index) => { + index.status.ready && (index.status.state == pinecone_sdk::models::State::Ready) + } Err(_) => false, } { break;