diff --git a/Cargo.lock b/Cargo.lock index 892e5aa..1c2289e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -725,12 +725,9 @@ dependencies = [ "mockito", "openapi", "regex", -<<<<<<< HEAD -======= "serde_json", "serial_test", "snafu", ->>>>>>> origin/main "tokio", ] diff --git a/pinecone_sdk/Cargo.toml b/pinecone_sdk/Cargo.toml index b6a6fa4..3bdebc4 100644 --- a/pinecone_sdk/Cargo.toml +++ b/pinecone_sdk/Cargo.toml @@ -8,10 +8,6 @@ edition = "2021" [dependencies] openapi = { path = "../openapi" } tokio = { version = "1", features = ["full"] } -<<<<<<< HEAD -mockito = "0.30" -regex = "1.10.4" -======= regex = "1.10.4" serde_json = "1.0.117" snafu = "0.8.3" @@ -19,4 +15,3 @@ snafu = "0.8.3" [dev-dependencies] mockito = "0.30" serial_test = "3.1.1" ->>>>>>> origin/main diff --git a/pinecone_sdk/src/control/create_index.rs b/pinecone_sdk/src/control/create_index.rs index c76b8d3..aba595f 100644 --- a/pinecone_sdk/src/control/create_index.rs +++ b/pinecone_sdk/src/control/create_index.rs @@ -66,11 +66,13 @@ mod tests { use core::panic; use mockito::mock; use openapi::models::serverless_spec; + use serial_test::serial; use tokio; #[tokio::test] + #[serial] async fn test_create_serverless_index_req() { - let pinecone = Pinecone::new("api_key".to_string(), Some("controller_url".to_string())); + let pinecone = Pinecone::new(Some("api_key".to_string()), Some("controller_url".to_string()), None, None); let params = CreateServerlessIndexRequest { name: "index_name".to_string(), dimension: 10, @@ -79,7 +81,7 @@ mod tests { region: "us-east-1".to_string(), }; - let create_index_request = pinecone.create_serverless_index_req(params); + let create_index_request = pinecone.expect("REASON").create_serverless_index_req(params); assert_eq!(create_index_request.name, "index_name"); assert_eq!(create_index_request.dimension, 10); assert_eq!(create_index_request.metric, Some(Metric::Cosine)); @@ -118,7 +120,7 @@ mod tests { ) .create(); - let pinecone = Pinecone::new("api_key".to_string(), Some(mockito::server_url())); + let pinecone = Pinecone::new(Some("api_key".to_string()), Some(mockito::server_url()), None, None); let params = CreateServerlessIndexRequest { name: "index_name".to_string(), dimension: 10, @@ -127,7 +129,7 @@ mod tests { region: "us-east-1".to_string(), }; - let result = pinecone.create_serverless_index(params).await; + let result = pinecone.expect("REASON").create_serverless_index(params).await; match result { Ok(index) => { diff --git a/pinecone_sdk/src/pinecone.rs b/pinecone_sdk/src/pinecone.rs index 23e4751..c282f7f 100644 --- a/pinecone_sdk/src/pinecone.rs +++ b/pinecone_sdk/src/pinecone.rs @@ -278,6 +278,7 @@ mod tests { pinecone.err().unwrap(), PineconeError::InvalidHeadersError { .. } )); + remove_env_var("PINECONE_ADDITIONAL_HEADERS"); } #[tokio::test] @@ -345,5 +346,6 @@ mod tests { pinecone.as_ref().unwrap().config.additional_headers, mock_arg_headers.clone() ); + } }