Skip to content

Commit 8f3e444

Browse files
committed
Extend Mock Configs class.
1 parent f40bc33 commit 8f3e444

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

tests/tests_unit/test_gdrive_preliminary_setup.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,27 @@ def test_preliminary_setup_for_gdrive(
1919
"""Test the outputs of `preliminary_setup_gdrive_config_for_without_browser` and check
2020
that they contain the correct credentials in the encoded format.
2121
"""
22-
mock_configs = {
23-
"gdrive_client_id": client_id,
24-
"gdrive_root_folder_id": root_folder_id,
25-
}
22+
from collections import UserDict
23+
from pathlib import Path
24+
25+
class MockConfigs(UserDict):
26+
def __init__(self, client_id_, root_folder_id_):
27+
super(MockConfigs, self).__init__()
28+
self.data["gdrive_client_id"] = client_id_
29+
self.data["gdrive_root_folder_id"] = root_folder_id_
30+
self.data["connection_method"] = "drive"
31+
32+
class RClone:
33+
def delete_existing_rclone_config_file(self):
34+
pass
35+
36+
def get_rclone_central_connection_config_filepath(self):
37+
return Path("")
38+
39+
self.rclone = RClone()
40+
41+
mock_configs = MockConfigs(client_id, root_folder_id)
42+
2643
output = rclone.preliminary_setup_gdrive_config_for_without_browser(
2744
mock_configs, client_secret, "test_gdrive_preliminary"
2845
)

0 commit comments

Comments
 (0)