From 99bded558c0edbf26335b83e207d6bea7f91e27a Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Sat, 21 Jun 2025 11:13:23 -0400 Subject: [PATCH] Add build download zip test --- tests/test_cli.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_cli.py b/tests/test_cli.py index 36eb6c9..328e18f 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -5,6 +5,7 @@ import shutil import json import datetime from pathlib import Path +import zipfile sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) @@ -90,3 +91,15 @@ def test_check_missing(capsys, monkeypatch): captured = capsys.readouterr() assert "node: missing" in captured.out + +def test_build_download_zip(tmp_path, monkeypatch): + _setup_tmp(monkeypatch, tmp_path) + config = json.load(open(tmp_path / "src" / "config.json")) + subdomain = config["subdomain"] + zip_path = tmp_path / "file.zip" + with zipfile.ZipFile(zip_path, "w") as zf: + zf.writestr("dummy.txt", "data") + cli.main(["build", "--download", str(zip_path)]) + dest = tmp_path / "host" / subdomain / "download" / "download.zip" + assert dest.is_file() +