diff options
Diffstat (limited to 'tests/upload_files.rs')
-rw-r--r-- | tests/upload_files.rs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/upload_files.rs b/tests/upload_files.rs index 77a9dc3..5fdf2cf 100644 --- a/tests/upload_files.rs +++ b/tests/upload_files.rs @@ -1,13 +1,15 @@ -mod fixtures; +use std::fs::create_dir_all; +use std::path::Path; use assert_fs::fixture::TempDir; -use fixtures::{server, server_no_stderr, tmpdir, Error, TestServer}; use reqwest::blocking::{multipart, Client}; use rstest::rstest; use select::document::Document; use select::predicate::{Attr, Text}; -use std::fs::create_dir_all; -use std::path::Path; + +mod fixtures; + +use crate::fixtures::{server, tmpdir, Error, TestServer}; #[rstest] fn uploading_files_works(#[with(&["-u"])] server: TestServer) -> Result<(), Error> { @@ -85,8 +87,8 @@ fn uploading_files_is_prevented(server: TestServer) -> Result<(), Error> { /// This test runs the server with --allowed-upload-dir argument and /// checks that file upload to a different directory is actually prevented. #[rstest] -#[case(server_no_stderr(&["-u", "someDir"]))] -#[case(server_no_stderr(&["-u", "someDir/some_sub_dir"]))] +#[case(server(&["-u", "someDir"]))] +#[case(server(&["-u", "someDir/some_sub_dir"]))] fn uploading_files_is_restricted(#[case] server: TestServer) -> Result<(), Error> { let test_file_name = "uploaded test file.txt"; @@ -219,7 +221,7 @@ fn prevent_path_traversal_attacks( /// See https://github.com/svenstaro/miniserve/issues/466 #[rstest] #[case(server(&["-u"]), true)] -#[case(server_no_stderr(&["-u", "--no-symlinks"]), false)] +#[case(server(&["-u", "--no-symlinks"]), false)] fn upload_to_symlink_directory( #[case] server: TestServer, #[case] ok: bool, |