tests: cover phase 1 commands end to end

Pytest suite with a tiny_client fixture, an ephemeral Ed25519 keypair
fixture, and a threaded HTTPServer helper. Exercises cli dispatch,
inspect (including excluded-path handling), build-manifest and sign
against the real m2dev-client scripts, diff-remote via a local server,
and the full release publish composite against a local rsync target.
This commit is contained in:
Jan Nedbal
2026-04-14 18:59:50 +02:00
parent e70fc300e2
commit d2dd2c88b6
13 changed files with 498 additions and 0 deletions

29
tests/fixtures/http_server.py vendored Normal file
View File

@@ -0,0 +1,29 @@
"""Minimal threaded HTTP server for diff-remote / verify-public tests."""
from __future__ import annotations
import contextlib
import threading
from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer
from pathlib import Path
from typing import Iterator
class _Handler(SimpleHTTPRequestHandler):
def log_message(self, format, *args): # noqa: A002
pass # silence
@contextlib.contextmanager
def serve_dir(root: Path) -> Iterator[str]:
"""Serve `root` on 127.0.0.1:<free port>, yield the base URL."""
handler = lambda *a, **kw: _Handler(*a, directory=str(root), **kw) # noqa: E731
server = ThreadingHTTPServer(("127.0.0.1", 0), handler)
thread = threading.Thread(target=server.serve_forever, daemon=True)
thread.start()
try:
yield f"http://127.0.0.1:{server.server_port}"
finally:
server.shutdown()
server.server_close()
thread.join(timeout=2)

1
tests/fixtures/tiny_client/Metin2.exe vendored Normal file
View File

@@ -0,0 +1 @@
fake main executable content

View File

@@ -0,0 +1 @@
fake launcher content

1
tests/fixtures/tiny_client/readme.txt vendored Normal file
View File

@@ -0,0 +1 @@
tiny client fixture for tests

View File

@@ -0,0 +1 @@
asset payload bytes

View File

@@ -0,0 +1 @@
second asset payload