✅ bring tests up to date
I definitely remember doing this already. I must have left the changes on my home PC.main
parent
94c5b0117f
commit
820c5aeef4
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
})
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue