From 981528173546a53b4bfbe7d25c8dc5e7d1e3550a Mon Sep 17 00:00:00 2001 From: Houkime <> Date: Fri, 14 Apr 2023 12:40:41 +0000 Subject: [PATCH] test(backups): actually back up 2 folders --- tests/test_graphql/test_backup.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/tests/test_graphql/test_backup.py b/tests/test_graphql/test_backup.py index ff89ccb..a14d268 100644 --- a/tests/test_graphql/test_backup.py +++ b/tests/test_graphql/test_backup.py @@ -19,6 +19,7 @@ from selfprivacy_api.backup.storage import Storage TESTFILE_BODY = "testytest!" +TESTFILE_2_BODY = "testissimo!" REPO_NAME = "test_backup" @@ -37,15 +38,23 @@ def backups_backblaze(generic_userdata): @pytest.fixture() def raw_dummy_service(tmpdir, backups): - service_dir = path.join(tmpdir, "test_service") - makedirs(service_dir) + dirnames = ["test_service", "also_test_service"] + service_dirs = [] + for d in dirnames: + service_dir = path.join(tmpdir, d) + makedirs(service_dir) + service_dirs.append(service_dir) - testfile_path = path.join(service_dir, "testfile.txt") - with open(testfile_path, "w") as file: + testfile_path_1 = path.join(service_dirs[0], "testfile.txt") + with open(testfile_path_1, "w") as file: file.write(TESTFILE_BODY) + testfile_path_2 = path.join(service_dirs[1], "testfile2.txt") + with open(testfile_path_2, "w") as file: + file.write(TESTFILE_2_BODY) + # we need this to not change get_folders() much - class TestDummyService(DummyService, folders=[service_dir]): + class TestDummyService(DummyService, folders=service_dirs): pass service = TestDummyService()