File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 11import os
2+ import textwrap
23
34from datashuttle .utils import rclone_encryption
45
89
910
1011class TestRcloneEncryption (BaseTest ):
11- def test_set_and_remove_password (self , project ):
12- """ """
12+ def test_set_and_remove_rclone_config_encryption (self , project ):
13+ """Test that RClone config encryption is set up and torn down correctly.
14+
15+ First, we generate a mock RClone config file or a mock SSH project.
16+ Then we check datashuttle functions for encryption, decryption and
17+ cleaning up environment variables work as expected.
18+ """
1319 ssh_test_utils .setup_project_for_ssh (
1420 project ,
1521 )
@@ -21,8 +27,6 @@ def test_set_and_remove_password(self, project):
2127 if rclone_config_path .exists ():
2228 rclone_config_path .unlink ()
2329
24- import textwrap
25-
2630 config_content = textwrap .dedent (f"""\
2731 [{ project .cfg .rclone .get_rclone_config_name ()} ]
2832 type = sftp
@@ -49,6 +53,7 @@ def test_set_and_remove_password(self, project):
4953
5054 assert "RCLONE_PASSWORD_COMMAND" not in os .environ
5155
56+ # Read the file contents to check it is no longer encrypted.
5257 with open (rclone_config_path , "r" , encoding = "utf-8" ) as f :
5358 first_line = f .readline ().strip ()
5459
You can’t perform that action at this time.
0 commit comments