bring tests up to date

I definitely remember doing this already. I must have left the changes on
my home PC.
main
_ 2022-04-22 11:37:20 -05:00
parent 94c5b0117f
commit 820c5aeef4
2 changed files with 14 additions and 5 deletions

View File

@ -67,7 +67,16 @@ fn file_server () {
let rt = Runtime::new ().expect ("Can't create runtime"); let rt = Runtime::new ().expect ("Can't create runtime");
rt.block_on (async { rt.block_on (async {
use super::internal::FileRoots;
let file_server_root = PathBuf::from ("./"); let file_server_root = PathBuf::from ("./");
let dirs = Default::default ();
let roots = FileRoots {
files: &file_server_root,
dirs: &dirs,
};
let headers = Default::default (); let headers = Default::default ();
{ {
@ -100,7 +109,7 @@ fn file_server () {
})), })),
] { ] {
let resp = internal::serve_all ( let resp = internal::serve_all (
&file_server_root, roots,
Method::Get, Method::Get,
uri_path, uri_path,
&headers, &headers,
@ -117,7 +126,7 @@ fn file_server () {
}), }),
] { ] {
let resp = internal::serve_all ( let resp = internal::serve_all (
&file_server_root, roots,
Method::Get, Method::Get,
uri_path, uri_path,
&headers, &headers,
@ -128,7 +137,7 @@ fn file_server () {
} }
let resp = internal::serve_all ( let resp = internal::serve_all (
&file_server_root, roots,
Method::Get, Method::Get,
bad_passwords_path, bad_passwords_path,
&hashmap! { &hashmap! {
@ -140,7 +149,7 @@ fn file_server () {
assert_eq! (resp.expect ("Should be Ok (_)"), RangeNotSatisfiable (1_048_576)); assert_eq! (resp.expect ("Should be Ok (_)"), RangeNotSatisfiable (1_048_576));
let resp = internal::serve_all ( let resp = internal::serve_all (
&file_server_root, roots,
Method::Head, Method::Head,
bad_passwords_path, bad_passwords_path,
&headers, &headers,

View File

@ -151,7 +151,7 @@ impl TestingServer {
let (stop_tx, stop_rx) = oneshot::channel (); let (stop_tx, stop_rx) = oneshot::channel ();
let task = { let task = {
spawn (async move { spawn (async move {
ptth_server::run_server (config_file, stop_rx, None, None).await ptth_server::run_server (config_file, stop_rx, None, None, None).await
}) })
}; };