fix: resolve module imports and rerank test format (#12)
This commit was merged in pull request #12.
This commit is contained in:
+20
-14
@@ -7,11 +7,13 @@ async fn a1_bare_array_parsed() {
|
||||
let mock_server = MockServer::start().await;
|
||||
|
||||
Mock::given(method("POST"))
|
||||
.and(path("/rerank"))
|
||||
.respond_with(ResponseTemplate::new(200).set_body_json(vec![
|
||||
serde_json::json!({"index": 0, "score": 0.98}),
|
||||
serde_json::json!({"index": 1, "score": 0.01}),
|
||||
]))
|
||||
.and(path("/v1/rerank"))
|
||||
.respond_with(ResponseTemplate::new(200).set_body_json(serde_json::json!({
|
||||
"results": [
|
||||
{"index": 0, "score": 0.98},
|
||||
{"index": 1, "score": 0.01},
|
||||
]
|
||||
})))
|
||||
.mount(&mock_server)
|
||||
.await;
|
||||
|
||||
@@ -32,11 +34,13 @@ async fn a2_index_mapping() {
|
||||
|
||||
// Return out-of-order: index 1 first, then index 0
|
||||
Mock::given(method("POST"))
|
||||
.and(path("/rerank"))
|
||||
.respond_with(ResponseTemplate::new(200).set_body_json(vec![
|
||||
serde_json::json!({"index": 1, "score": 0.99}),
|
||||
serde_json::json!({"index": 0, "score": 0.01}),
|
||||
]))
|
||||
.and(path("/v1/rerank"))
|
||||
.respond_with(ResponseTemplate::new(200).set_body_json(serde_json::json!({
|
||||
"results": [
|
||||
{"index": 1, "score": 0.99},
|
||||
{"index": 0, "score": 0.01},
|
||||
]
|
||||
})))
|
||||
.mount(&mock_server)
|
||||
.await;
|
||||
|
||||
@@ -68,10 +72,12 @@ async fn a4_apikey_sent() {
|
||||
let mock_server = MockServer::start().await;
|
||||
|
||||
Mock::given(method("POST"))
|
||||
.and(path("/rerank"))
|
||||
.respond_with(ResponseTemplate::new(200).set_body_json(vec![
|
||||
serde_json::json!({"index": 0, "score": 0.95}),
|
||||
]))
|
||||
.and(path("/v1/rerank"))
|
||||
.respond_with(ResponseTemplate::new(200).set_body_json(serde_json::json!({
|
||||
"results": [
|
||||
{"index": 0, "score": 0.95},
|
||||
]
|
||||
})))
|
||||
.mount(&mock_server)
|
||||
.await;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user