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

View File

@ -151,7 +151,7 @@ impl TestingServer {
let (stop_tx, stop_rx) = oneshot::channel ();
let task = {
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
})
};