Stop shipping code that implied Aman supported a two-pass editor, external API cleanup, or a Wayland scaffold when the runtime only exercises single-pass local cleanup on X11.\n\nCollapse aiprocess to the active single-pass Llama contract, delete desktop_wayland and the empty wayland extra, and make model_eval reject pass1_/pass2_ tuning keys while keeping pass1_ms/pass2_ms as report compatibility fields.\n\nRemove the unused pillow dependency, switch to SPDX-style license metadata, and clean setuptools build state before packaging so deleted modules do not leak into wheels. Update the methodology and repo guidance docs, and add focused tests for desktop adapter selection, stale param rejection, and portable wheel contents.\n\nValidate with uv lock, python3 -m unittest discover -s tests -p 'test_*.py', python3 -m py_compile src/*.py tests/*.py, and python3 -m build --wheel --sdist --no-isolation.
42 lines
1.1 KiB
Python
42 lines
1.1 KiB
Python
import os
|
|
import sys
|
|
import types
|
|
import unittest
|
|
from pathlib import Path
|
|
from unittest.mock import patch
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
SRC = ROOT / "src"
|
|
if str(SRC) not in sys.path:
|
|
sys.path.insert(0, str(SRC))
|
|
|
|
import desktop
|
|
|
|
|
|
class _FakeX11Adapter:
|
|
pass
|
|
|
|
|
|
class DesktopTests(unittest.TestCase):
|
|
def test_get_desktop_adapter_loads_x11_adapter(self):
|
|
fake_module = types.SimpleNamespace(X11Adapter=_FakeX11Adapter)
|
|
|
|
with patch.dict(sys.modules, {"desktop_x11": fake_module}), patch.dict(
|
|
os.environ,
|
|
{"XDG_SESSION_TYPE": "x11"},
|
|
clear=True,
|
|
):
|
|
adapter = desktop.get_desktop_adapter()
|
|
|
|
self.assertIsInstance(adapter, _FakeX11Adapter)
|
|
|
|
def test_get_desktop_adapter_rejects_wayland_session(self):
|
|
with patch.dict(os.environ, {"XDG_SESSION_TYPE": "wayland"}, clear=True):
|
|
with self.assertRaises(SystemExit) as ctx:
|
|
desktop.get_desktop_adapter()
|
|
|
|
self.assertIn("Wayland is not supported yet", str(ctx.exception))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|