From 915fa0637308d1516ab570c67939dfd7688e5d02 Mon Sep 17 00:00:00 2001 From: CodyCBakerPhD Date: Mon, 1 Jul 2024 14:21:31 -0400 Subject: [PATCH] try expanding rclone call --- dockerfiles/rclone_with_config | 2 +- tests/docker_rclone_with_config_cli.py | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/dockerfiles/rclone_with_config b/dockerfiles/rclone_with_config index 9aae9db3b..8d4b75703 100644 --- a/dockerfiles/rclone_with_config +++ b/dockerfiles/rclone_with_config @@ -1,5 +1,5 @@ FROM rclone/rclone:latest LABEL org.opencontainers.image.source=https://github.com/catalystneuro/neuroconv LABEL org.opencontainers.image.description="A simple extension of the basic Rclone docker image to automatically create a local .conf file from contents passed via an environment variable." -CMD printf "$RCLONE_CONFIG" > ./rclone.conf && echo "$(pwd)" && cat ./rclone.conf && $RCLONE_COMMANNDS +CMD printf "$RCLONE_CONFIG" > ./rclone.conf && echo "$(pwd)" && cat ./rclone.conf && rclone $RCLONE_COMMANNDS ENTRYPOINT [""] diff --git a/tests/docker_rclone_with_config_cli.py b/tests/docker_rclone_with_config_cli.py index 3cf6d3819..5d3ac558d 100644 --- a/tests/docker_rclone_with_config_cli.py +++ b/tests/docker_rclone_with_config_cli.py @@ -62,7 +62,7 @@ def test_rclone_with_config(self): os.environ["RCLONE_CONFIG"] = rclone_config_file_stream os.environ["RCLONE_COMMAND"] = ( - f"rclone copy test_google_drive_remote:testing_rclone_with_config {self.test_folder} --verbose --progress" + f"copy test_google_drive_remote:testing_rclone_with_config {self.test_folder} --verbose --progress" ) output = deploy_process( @@ -80,11 +80,14 @@ def test_rclone_with_config(self): # The .conf file created inside the container should not be viewable outside the running container # (it was not saved to mounted location) - print(list(self.test_folder.iterdir())) + test_folder_contents_after_call = list(self.test_folder.iterdir()) + assert len(test_folder_contents_after_call) != 0, f"Test folder {self.test_folder} is empty!" testing_file_path = self.test_folder / "testing_rclone_with_config" / "ci_tests" / "test_text_file.txt" - assert testing_file_path.is_file() + assert testing_file_path.is_file(), "The specific test transfer file does not exist!" with open(file=testing_file_path, mode="r") as io: file_content = io.read() - assert file_content == "This is a test file for the Rclone (with config) docker image hosted on NeuroConv!" + assert ( + file_content == "This is a test file for the Rclone (with config) docker image hosted on NeuroConv!" + ), "The file content does not match expectations!"