Add QR pairing (terminal QR, in-app scanner, iris://pair deep link)
This commit is contained in:
1 parent
27dc7917f2
commit
7a6d922d12
63 files changed
+2073
-630
No files matched your search
@@ -1,4 +1,4 @@
|
||||
"""Tests for the android plugin's HTTP fallback transport (docs/19).
|
||||
"""Tests for the iris plugin's HTTP fallback transport (docs/19).
|
||||
|
||||
The plugin lives in the sibling ``iris_x_hermes`` checkout; tests load it
|
||||
from the source tree directly (same pattern as ``test_android.py``).
|
||||
@@ -44,9 +44,9 @@ import pytest_asyncio
|
||||
# Test-only token (not a credential; the adapter is built with it via
|
||||
# monkeypatch in the fixture below).
|
||||
# pi-lens-ignore: S105
|
||||
TOKEN = "test-android-http-token-0123456789"
|
||||
TOKEN = "test-iris-http-token-0123456789"
|
||||
DEVICE_ID = "test-http-device"
|
||||
CHAT_ID = "android:default"
|
||||
CHAT_ID = "default"
|
||||
|
||||
# 1x1 PNG (same fixture as test_android.py).
|
||||
PNG_1X1 = base64.b64decode(
|
||||
@@ -56,7 +56,7 @@ PNG_1X1 = base64.b64decode(
|
||||
|
||||
|
||||
def _plugin_dir() -> Path:
|
||||
env = os.environ.get("ANDROID_PLUGIN_DIR")
|
||||
env = os.environ.get("IRIS_PLUGIN_DIR")
|
||||
if env:
|
||||
return Path(env)
|
||||
# Works from either copy of this file: gateway-plugin/tests/ (canonical,
|
||||
@@ -72,13 +72,13 @@ def _plugin_dir() -> Path:
|
||||
def _load_plugin():
|
||||
"""Load the gateway-plugin package under a unique module name (same
|
||||
pattern as test_android.py)."""
|
||||
name = "android_plugin_http_under_test"
|
||||
name = "iris_plugin_http_under_test"
|
||||
cached = sys.modules.get(name)
|
||||
if cached is not None:
|
||||
return cached
|
||||
pkg_dir = _plugin_dir()
|
||||
if not (pkg_dir / "__init__.py").is_file():
|
||||
pytest.fail(f"android plugin not found at {pkg_dir}")
|
||||
pytest.fail(f"iris plugin not found at {pkg_dir}")
|
||||
spec = importlib.util.spec_from_file_location(
|
||||
name, pkg_dir / "__init__.py", submodule_search_locations=[str(pkg_dir)]
|
||||
)
|
||||
@@ -101,14 +101,14 @@ def plugin():
|
||||
|
||||
@pytest.fixture
|
||||
def adapter(plugin, monkeypatch):
|
||||
"""A live AndroidAdapter with an isolated HERMES_HOME (conftest)."""
|
||||
monkeypatch.setenv("ANDROID_TOKEN", TOKEN)
|
||||
"""A live IrisAdapter with an isolated HERMES_HOME (conftest)."""
|
||||
monkeypatch.setenv("IRIS_TOKEN", TOKEN)
|
||||
from gateway.platform_registry import PlatformEntry, platform_registry
|
||||
|
||||
if not platform_registry.is_registered("android"):
|
||||
if not platform_registry.is_registered("iris"):
|
||||
platform_registry.register(
|
||||
PlatformEntry(
|
||||
name="android",
|
||||
name="iris",
|
||||
label="Android",
|
||||
adapter_factory=lambda cfg: None,
|
||||
check_fn=lambda: True,
|
||||
@@ -124,7 +124,7 @@ def adapter(plugin, monkeypatch):
|
||||
},
|
||||
home_channel=None,
|
||||
)
|
||||
a = plugin.adapter.AndroidAdapter(config)
|
||||
a = plugin.adapter.IrisAdapter(config)
|
||||
yield a
|
||||
with contextlib.suppress(Exception):
|
||||
a._devices.close()
|
||||
|
||||
Reference in new issue
Block a user