forked from kenzuya/unshackle
feat(remote)!: make remote serve WebSocket-only and refuse older clients with CLIENT_OUTDATED
This commit is contained in:
@@ -37,7 +37,6 @@ from unshackle.core.api.handlers import (
|
||||
)
|
||||
from unshackle.core.api.routes import setup_routes
|
||||
from unshackle.core.remote_protocol import (
|
||||
PROMPT_ROUTE,
|
||||
SESSION_ROUTE,
|
||||
TITLES_ROUTE,
|
||||
APIErrorCode,
|
||||
@@ -148,10 +147,8 @@ def nothing(stub: StubService) -> None:
|
||||
(True, ask, nothing),
|
||||
(True, poll_a_device, nothing),
|
||||
(True, nothing, ask),
|
||||
(False, ask, nothing),
|
||||
(False, poll_a_device, nothing),
|
||||
],
|
||||
ids=["prompt", "device", "prompt-after-login", "prompt-polling", "device-polling"],
|
||||
ids=["prompt", "device", "prompt-after-login"],
|
||||
indirect=["server"],
|
||||
)
|
||||
def test_a_stop_ends_a_remote_login(
|
||||
@@ -165,9 +162,7 @@ def test_a_stop_ends_a_remote_login(
|
||||
monkeypatch.setattr(StubService, "authenticate", lambda self, cookies, credential: login(self))
|
||||
StubService.hooks["titles"] = titles
|
||||
reply = relay.list()
|
||||
assert wait_until(
|
||||
lambda: count(server, "GET", PROMPT_ROUTE) > 0 or any(entry.channel.attached for entry in sessions()), DEADLINE
|
||||
)
|
||||
assert wait_until(lambda: any(entry.channel.attached for entry in sessions()), DEADLINE)
|
||||
assert ask not in (login, titles) or wait_until(relay.asks, DEADLINE)
|
||||
relay.stop()
|
||||
relay.ended_well()
|
||||
|
||||
Reference in New Issue
Block a user