aboutsummaryrefslogtreecommitdiffstats
path: root/tests/upload_files.rs
diff options
context:
space:
mode:
authorSven-Hendrik Haase <svenstaro@gmail.com>2025-02-07 12:48:50 +0000
committerGitHub <noreply@github.com>2025-02-07 12:48:50 +0000
commit77b1c1cd0bfab5d4dc5e0994050fabd4a19cdd0f (patch)
tree0b9e157598d2361397ee09e7f196938d284c48f9 /tests/upload_files.rs
parentchore: clean up (diff)
parentAdd CHANGELOG entry for #1473 (diff)
downloadminiserve-77b1c1cd0bfab5d4dc5e0994050fabd4a19cdd0f.tar.gz
miniserve-77b1c1cd0bfab5d4dc5e0994050fabd4a19cdd0f.zip
Merge branch 'master' into upload-progress-bar
Diffstat (limited to 'tests/upload_files.rs')
-rw-r--r--tests/upload_files.rs16
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,