diff options
author | Bryan Newbold <bnewbold@archive.org> | 2020-08-26 17:51:42 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2020-08-26 17:51:42 -0700 |
commit | c848647acf7aa967da4f2b9ec89843f208fb4e24 (patch) | |
tree | a3c2d2db16ced1113a5778118a2e90047458087f /tests/parse_es_requests.rs | |
parent | 837e726d279c0b82418d0bd465657e0ea8de2b15 (diff) | |
download | es-public-proxy-c848647acf7aa967da4f2b9ec89843f208fb4e24.tar.gz es-public-proxy-c848647acf7aa967da4f2b9ec89843f208fb4e24.zip |
more tests
Diffstat (limited to 'tests/parse_es_requests.rs')
-rw-r--r-- | tests/parse_es_requests.rs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/parse_es_requests.rs b/tests/parse_es_requests.rs index e6f747f..e00b12f 100644 --- a/tests/parse_es_requests.rs +++ b/tests/parse_es_requests.rs @@ -87,6 +87,24 @@ fn filter_scroll_requests() { } #[test] +fn filter_other_requests() { + let file_paths = fs::read_dir("tests/files/other").unwrap(); + let mut config = ProxyConfig::default(); + config.unsafe_all_indices = Some(true); + let mut rt = tokio::runtime::Runtime::new().unwrap(); + + for path in file_paths { + let path = path.unwrap().path(); + if path.extension() != Some(OsStr::new("txt")) { + continue; + } + println!(" filtering: {}", path.display()); + let req = common::load_request(&path); + rt.block_on(filter_request(req, &config)).unwrap(); + } +} + +#[test] fn filter_failures() { let file_paths = fs::read_dir("tests/files/search_fail").unwrap(); let mut config = ProxyConfig::default(); @@ -116,4 +134,17 @@ fn filter_failures() { let result = rt.block_on(filter_request(req, &config)); assert!(result.is_err()); } + + let file_paths = fs::read_dir("tests/files/other_fail").unwrap(); + + for path in file_paths { + let path = path.unwrap().path(); + if path.extension() != Some(OsStr::new("txt")) { + continue; + } + println!(" filtering: {}", path.display()); + let req = common::load_request(&path); + let result = rt.block_on(filter_request(req, &config)); + assert!(result.is_err()); + } } |