mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Added support for specifying compression in tests
Refactored tests code to allow to specify compression (content-encoding) algorithm. Added tests to verify what actix actually handle different content encodings properly.
This commit is contained in:
parent
7607a62531
commit
11b986a81d
9 changed files with 224 additions and 128 deletions
|
@ -12,6 +12,7 @@ use once_cell::sync::Lazy;
|
|||
use serde_json::Value;
|
||||
use tempfile::TempDir;
|
||||
|
||||
use crate::common::encoder::Encoder;
|
||||
use meilisearch_http::option::Opt;
|
||||
|
||||
use super::index::Index;
|
||||
|
@ -100,9 +101,14 @@ impl Server {
|
|||
|
||||
/// Returns a view to an index. There is no guarantee that the index exists.
|
||||
pub fn index(&self, uid: impl AsRef<str>) -> Index<'_> {
|
||||
self.index_with_encoder(uid, Encoder::Plain)
|
||||
}
|
||||
|
||||
pub fn index_with_encoder(&self, uid: impl AsRef<str>, encoder: Encoder) -> Index<'_> {
|
||||
Index {
|
||||
uid: uid.as_ref().to_string(),
|
||||
service: &self.service,
|
||||
encoder,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue