Re #348 - Add test for backup, use proper datastore path

This commit is contained in:
dgtlmoon
2022-01-03 20:16:21 +01:00
parent 023951a10e
commit b33105d576
2 changed files with 34 additions and 8 deletions

View File

@@ -0,0 +1,25 @@
#!/usr/bin/python3
import time
from flask import url_for
from urllib.request import urlopen
from . util import set_original_response, set_modified_response, live_server_setup
def test_backup(client, live_server):
live_server_setup(live_server)
# Give the endpoint time to spin up
time.sleep(1)
res = client.get(
url_for("get_backup"),
follow_redirects=True
)
# Should get the right zip content type
assert res.content_type == "application/zip"
# Should be PK/ZIP stream
assert res.data.count(b'PK') >= 2