fix(remote): end a remote session from before its create to after its DELETE

This commit is contained in:
imSp4rky
2026-11-30 13:56:59 -07:00
parent 3634fc5686
commit 34a3820eb8
34 changed files with 1719 additions and 276 deletions
+7 -4
View File
@@ -10,7 +10,7 @@ from typing import Any
import pytest
import yaml
from unshackle.core import remote_channel
from unshackle.core import remote_channel, remote_lifetime
from unshackle.core import remote_protocol as protocol
from unshackle.core import remote_service
from unshackle.core.api import routes
@@ -23,7 +23,6 @@ CLIENT_METHODS = {
"probe": "GET",
"post": "POST",
"post_optional": "POST",
"delete": "DELETE",
"ws_connect": "GET",
}
SERVED = {(method, path): handler for method, path, handler, _ in routes.ROUTES}
@@ -31,8 +30,11 @@ SERVED = {(method, path): handler for method, path, handler, _ in routes.ROUTES}
@functools.cache
def client_tree() -> ast.Module:
"""The client modules as one tree: the remote service and the session channel adapters."""
modules = [ast.parse(Path(m.__file__).read_text(encoding="utf-8")) for m in (remote_service, remote_channel)]
"""The client modules as one tree: the remote service, the session channel adapters and the session lifetime."""
modules = [
ast.parse(Path(m.__file__).read_text(encoding="utf-8"))
for m in (remote_service, remote_channel, remote_lifetime)
]
return ast.Module(body=[node for module in modules for node in module.body], type_ignores=[])
@@ -140,6 +142,7 @@ def test_session_transport_keys_are_the_create_body():
assert SESSION_TRANSPORT_KEYS == {
"service",
"title_id",
"session_id",
"profile",
"service_params",
"season",