summaryrefslogtreecommitdiffstats
path: root/tests/parse_es_requests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/parse_es_requests.rs')
-rw-r--r--tests/parse_es_requests.rs23
1 files changed, 21 insertions, 2 deletions
diff --git a/tests/parse_es_requests.rs b/tests/parse_es_requests.rs
index 57be06a..a4950c0 100644
--- a/tests/parse_es_requests.rs
+++ b/tests/parse_es_requests.rs
@@ -1,7 +1,7 @@
use std::fs;
use std::ffi::OsStr;
-use es_public_proxy::SearchBody;
+use es_public_proxy::{ScrollBody, SearchBody};
mod common;
@@ -22,7 +22,7 @@ fn basic_parse() {
}
#[test]
-fn parse_all_requests() {
+fn parse_search_requests() {
let file_paths = fs::read_dir("tests/files").unwrap();
@@ -39,3 +39,22 @@ fn parse_all_requests() {
}
}
}
+
+#[test]
+fn parse_scroll_requests() {
+
+ 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
+ }
+ let request = common::load_request(&path);
+ if let Some(body) = request.body {
+ println!("parsing: {}", path.display());
+ println!("BODY: {}", body);
+ let _parsed: ScrollBody = serde_json::from_str(&body).unwrap();
+ }
+ }
+}