"""Usage: python3 seed-zip-fixtures.py <directory>; set ZIP_FIXTURE_DIR to that directory when running the scenario."""
from pathlib import Path
import sys
import zipfile
import subprocess
p = Path(sys.argv[1])
p.mkdir(parents=True, exist_ok=True)
for label, suffix in [('lower', 'xml'), ('upper', 'XML'), ('mixed', 'Xml')]:
    name = 'document.' + suffix
    data = b'<root>' + b' ' * (9 * 1024 * 1024 - 13) + b'</root>'
    with zipfile.ZipFile(p / (label + '.zip'), 'w', compression=zipfile.ZIP_STORED) as z:
        z.writestr(name, data)
    (p / name).write_bytes(data)
    subprocess.run(['zip', '-0', '-P', 'open me', str((p / (label + '-enc.zip')).resolve()), name], cwd=p, check=True)
