Skip to content

Commit

Permalink
fixed more merge conflicts and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ericapywang committed Jun 7, 2024
1 parent 11530db commit 35fbed4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
3 changes: 0 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions pinecone_sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,10 @@ 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"

[dev-dependencies]
mockito = "0.30"
serial_test = "3.1.1"
>>>>>>> origin/main
10 changes: 6 additions & 4 deletions pinecone_sdk/src/control/create_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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));
Expand Down Expand Up @@ -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,
Expand All @@ -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) => {
Expand Down
2 changes: 2 additions & 0 deletions pinecone_sdk/src/pinecone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ mod tests {
pinecone.err().unwrap(),
PineconeError::InvalidHeadersError { .. }
));
remove_env_var("PINECONE_ADDITIONAL_HEADERS");
}

#[tokio::test]
Expand Down Expand Up @@ -345,5 +346,6 @@ mod tests {
pinecone.as_ref().unwrap().config.additional_headers,
mock_arg_headers.clone()
);

}
}

0 comments on commit 35fbed4

Please sign in to comment.