aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-08-24 14:13:56 -0700
committerBryan Newbold <bnewbold@archive.org>2020-08-24 14:13:56 -0700
commit780ca2a819a6d1c931580c8e8e31657072971876 (patch)
treec963e141d8665a07a8a07cab8159b74a66aabe74 /tests
parentf466739b09be1baffd13110b431ecd8057a40771 (diff)
downloades-public-proxy-780ca2a819a6d1c931580c8e8e31657072971876.tar.gz
es-public-proxy-780ca2a819a6d1c931580c8e8e31657072971876.zip
more progress and tests
Diffstat (limited to 'tests')
-rw-r--r--tests/files/scroll/DELETE_scroll_body.txt (renamed from tests/files/DELETE_scroll_body.txt)0
-rw-r--r--tests/files/scroll/DELETE_scroll_path.txt (renamed from tests/files/DELETE_scroll_path.txt)0
-rw-r--r--tests/files/scroll/POST_scroll_continue.txt (renamed from tests/files/POST_scroll_continue.txt)0
-rw-r--r--tests/parse_es_requests.rs23
4 files changed, 21 insertions, 2 deletions
diff --git a/tests/files/DELETE_scroll_body.txt b/tests/files/scroll/DELETE_scroll_body.txt
index 26960a9..26960a9 100644
--- a/tests/files/DELETE_scroll_body.txt
+++ b/tests/files/scroll/DELETE_scroll_body.txt
diff --git a/tests/files/DELETE_scroll_path.txt b/tests/files/scroll/DELETE_scroll_path.txt
index 7910ed8..7910ed8 100644
--- a/tests/files/DELETE_scroll_path.txt
+++ b/tests/files/scroll/DELETE_scroll_path.txt
diff --git a/tests/files/POST_scroll_continue.txt b/tests/files/scroll/POST_scroll_continue.txt
index 9aef4d3..9aef4d3 100644
--- a/tests/files/POST_scroll_continue.txt
+++ b/tests/files/scroll/POST_scroll_continue.txt
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();
+ }
+ }
+}