mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-27 16:51:01 +00: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:
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user