mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-01 21:45:10 +00:00
fix(remote): end a remote session from before its create to after its DELETE
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user