aboutsummaryrefslogtreecommitdiffstats
path: root/tests/upload_files.rs
diff options
context:
space:
mode:
authorJonas Diemer <jonasdiemer@gmail.com>2022-08-15 20:15:57 +0000
committerJonas Diemer <jonasdiemer@gmail.com>2022-09-18 18:25:37 +0000
commite2ae526727e0154a1bc618971011788ee24e8748 (patch)
tree395e682abde8f39f4d71fd4a406f473eaec72118 /tests/upload_files.rs
parentcheck status code when restricted; fix formatting (diff)
downloadminiserve-e2ae526727e0154a1bc618971011788ee24e8748.tar.gz
miniserve-e2ae526727e0154a1bc618971011788ee24e8748.zip
Use argument -u instead of --allowed-upload-dir
Diffstat (limited to '')
-rw-r--r--tests/upload_files.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/upload_files.rs b/tests/upload_files.rs
index de96aff..ca9f007 100644
--- a/tests/upload_files.rs
+++ b/tests/upload_files.rs
@@ -84,8 +84,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", "--allowed-upload-dir", "someDir"]))]
-#[case(server_no_stderr(&["-u", "--allowed-upload-dir", "someDir/some_sub_dir"]))]
+#[case(server_no_stderr(&["-u", "someDir"]))]
+#[case(server_no_stderr(&["-u", "someDir/some_sub_dir"]))]
fn uploading_files_is_restricted(#[case] server: TestServer) -> Result<(), Error> {
let test_file_name = "uploaded test file.txt";
@@ -117,9 +117,9 @@ fn uploading_files_is_restricted(#[case] server: TestServer) -> Result<(), Error
/// This tests that we can upload files to the directory specified by --allow-upload-dir
#[rstest]
-#[case(server(&["-u", "--allowed-upload-dir", "someDir"]), vec!["someDir"])]
-#[case(server(&["-u", "--allowed-upload-dir", "someDir/some_sub_dir"]), vec!["someDir/some_sub_dir"])]
-#[case(server(&["-u", "--allowed-upload-dir", "someDir/some_sub_dir", "--allowed-upload-dir", "someDir/some_other_dir"]),
+#[case(server(&["-u", "someDir"]), vec!["someDir"])]
+#[case(server(&["-u", "someDir/some_sub_dir"]), vec!["someDir/some_sub_dir"])]
+#[case(server(&["-u", "someDir/some_sub_dir", "-u", "someDir/some_other_dir"]),
vec!["someDir/some_sub_dir", "someDir/some_other_dir"])]
fn uploading_files_to_allowed_dir_works(
#[case] server: TestServer,