diff options
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.rs | 23 |
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(); + } + } +} |