From 4dc634655edac54e9638e8390d89a96e235522c0 Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Fri, 10 Jan 2025 17:23:00 +0100 Subject: Reorganize imports to be more consistent --- tests/upload_files.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tests/upload_files.rs') diff --git a/tests/upload_files.rs b/tests/upload_files.rs index 77a9dc3..72548e4 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, server_no_stderr, tmpdir, Error, TestServer}; #[rstest] fn uploading_files_works(#[with(&["-u"])] server: TestServer) -> Result<(), Error> { -- cgit v1.2.3 From f0eb61436e62d0d0d755ac8280bf97b4b52d4e0b Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Thu, 6 Feb 2025 04:30:28 +0100 Subject: Get rid of server_no_stderr We'll now always just pipe the contents of the child to the parent. --- tests/upload_files.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/upload_files.rs') diff --git a/tests/upload_files.rs b/tests/upload_files.rs index 72548e4..5fdf2cf 100644 --- a/tests/upload_files.rs +++ b/tests/upload_files.rs @@ -9,7 +9,7 @@ use select::predicate::{Attr, Text}; mod fixtures; -use crate::fixtures::{server, server_no_stderr, tmpdir, Error, TestServer}; +use crate::fixtures::{server, tmpdir, Error, TestServer}; #[rstest] fn uploading_files_works(#[with(&["-u"])] server: TestServer) -> Result<(), Error> { @@ -87,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"; @@ -221,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, -- cgit v1.2.3