test(dkim): separate dummy dkim into a folder

This commit is contained in:
Houkime 2024-07-25 17:21:44 +00:00
parent c5c6d860fd
commit 35e2e8cc78

View file

@ -16,14 +16,18 @@ def dkim_file(mocker, tmpdir, generic_userdata):
domain = get_domain() domain = get_domain()
assert domain is not None assert domain is not None
assert domain != "" assert domain != ""
# In a separate folder to not interfere with dkim backups
dkim_dir = path.join(tmpdir, "dkim")
os.mkdir(dkim_dir)
filename = domain + ".selector.txt" filename = domain + ".selector.txt"
dkim_path = path.join(tmpdir, filename) dkim_path = path.join(dkim_dir, filename)
with open(dkim_path, "wb") as file: with open(dkim_path, "wb") as file:
file.write(DKIM_FILE_CONTENT) file.write(DKIM_FILE_CONTENT)
mocker.patch("selfprivacy_api.utils.DKIM_DIR", tmpdir) mocker.patch("selfprivacy_api.utils.DKIM_DIR", dkim_dir)
mocker.patch("selfprivacy_api.services.DKIM_DIR", dkim_dir)
return dkim_path return dkim_path