mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-24 04:51:27 +00:00
test(backups): actually back up 2 folders
This commit is contained in:
parent
d38872072d
commit
9815281735
|
@ -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")
|
||||
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()
|
||||
|
|
Loading…
Reference in a new issue