aboutsummaryrefslogtreecommitdiffstats
path: root/tests/parse_es_requests.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-08-25 18:59:34 -0700
committerBryan Newbold <bnewbold@archive.org>2020-08-25 18:59:34 -0700
commit52c8213c0889f0ff16ff48c83121fb41bad56ba7 (patch)
tree14d1ae8d8f9ccc6f019b788bb97d48a949d93e32 /tests/parse_es_requests.rs
parent2f9054309e3d12be5b9d9be56c09e935c0bc0c06 (diff)
downloades-public-proxy-52c8213c0889f0ff16ff48c83121fb41bad56ba7.tar.gz
es-public-proxy-52c8213c0889f0ff16ff48c83121fb41bad56ba7.zip
fmt
Diffstat (limited to 'tests/parse_es_requests.rs')
-rw-r--r--tests/parse_es_requests.rs24
1 files changed, 9 insertions, 15 deletions
diff --git a/tests/parse_es_requests.rs b/tests/parse_es_requests.rs
index a55e461..c8081c7 100644
--- a/tests/parse_es_requests.rs
+++ b/tests/parse_es_requests.rs
@@ -1,8 +1,7 @@
-
-use std::fs;
-use std::ffi::OsStr;
use es_public_proxy::parse::{ScrollBody, SearchBody};
-use es_public_proxy::{ProxyConfig, filter_request};
+use es_public_proxy::{filter_request, ProxyConfig};
+use std::ffi::OsStr;
+use std::fs;
mod common;
@@ -15,13 +14,12 @@ fn basic_load() {
#[test]
fn parse_search_bodies() {
-
let file_paths = fs::read_dir("tests/files/search").unwrap();
for path in file_paths {
let path = path.unwrap().path();
if path.extension() != Some(OsStr::new("txt")) {
- continue
+ continue;
}
let parts = common::load_parts(&path);
if let Some(body) = parts.body {
@@ -36,13 +34,12 @@ fn parse_search_bodies() {
#[test]
fn parse_scroll_bodies() {
-
let file_paths = fs::read_dir("tests/files/scroll").unwrap();
for path in file_paths {
let path = path.unwrap().path();
if path.extension() != Some(OsStr::new("txt")) {
- continue
+ continue;
}
let parts = common::load_parts(&path);
if let Some(body) = parts.body {
@@ -55,7 +52,6 @@ fn parse_scroll_bodies() {
#[test]
fn filter_search_requests() {
-
let file_paths = fs::read_dir("tests/files/search").unwrap();
let mut config = ProxyConfig::default();
config.allow_all_indices = Some(true);
@@ -64,7 +60,7 @@ fn filter_search_requests() {
for path in file_paths {
let path = path.unwrap().path();
if path.extension() != Some(OsStr::new("txt")) {
- continue
+ continue;
}
println!(" filtering: {}", path.display());
let req = common::load_request(&path);
@@ -74,7 +70,6 @@ fn filter_search_requests() {
#[test]
fn filter_scroll_requests() {
-
let file_paths = fs::read_dir("tests/files/scroll").unwrap();
let mut config = ProxyConfig::default();
config.allow_all_indices = Some(true);
@@ -83,7 +78,7 @@ fn filter_scroll_requests() {
for path in file_paths {
let path = path.unwrap().path();
if path.extension() != Some(OsStr::new("txt")) {
- continue
+ continue;
}
println!(" filtering: {}", path.display());
let req = common::load_request(&path);
@@ -93,7 +88,6 @@ fn filter_scroll_requests() {
#[test]
fn filter_failures() {
-
let file_paths = fs::read_dir("tests/files/search_fail").unwrap();
let mut config = ProxyConfig::default();
config.allow_all_indices = Some(true);
@@ -102,7 +96,7 @@ fn filter_failures() {
for path in file_paths {
let path = path.unwrap().path();
if path.extension() != Some(OsStr::new("txt")) {
- continue
+ continue;
}
println!(" filtering: {}", path.display());
let req = common::load_request(&path);
@@ -115,7 +109,7 @@ fn filter_failures() {
for path in file_paths {
let path = path.unwrap().path();
if path.extension() != Some(OsStr::new("txt")) {
- continue
+ continue;
}
println!(" filtering: {}", path.display());
let req = common::load_request(&path);