fix: flow VERSION=2 for new entries; optional ENTER gains the ADB keyevent-66 fallback; CI installs androidtvremote2 for the real-library tests (F4, F5, F6)
This commit is contained in:
1 parent
8462ad494c
commit
5f8c3290cc
6 files changed
+50
-6
No files matched your search
@@ -55,6 +55,7 @@ class FakeAdbPoller:
|
||||
def __init__(self):
|
||||
self.media_calls: list[str] = []
|
||||
self.digits: list[str] = []
|
||||
self.enter_calls: list[bool] = []
|
||||
self.results: dict[str, bool] = {}
|
||||
self.digit_result = True
|
||||
|
||||
@@ -70,6 +71,10 @@ class FakeAdbPoller:
|
||||
self.digits.append(digit)
|
||||
return self.digit_result
|
||||
|
||||
async def send_enter_keyevent(self) -> bool:
|
||||
self.enter_calls.append(True)
|
||||
return True
|
||||
|
||||
async def bring_to_foreground(self, package: str) -> bool:
|
||||
return True
|
||||
|
||||
@@ -214,6 +219,23 @@ class TestChannelDigits:
|
||||
assert player._manager._poller.digits == ["5"] # ADB digit keyevent served
|
||||
assert served == []
|
||||
|
||||
async def test_optional_enter_falls_back_to_adb_keyevent(self, modules):
|
||||
player, served, _i = make_player(modules)
|
||||
protocol = player._manager._protocol
|
||||
poller = player._manager._poller
|
||||
protocol.fail_keys.add("KEYCODE_ENTER")
|
||||
protocol.key_calls.clear()
|
||||
|
||||
player._entry.options["channel_send_enter"] = True # §7 optional ENTER on
|
||||
|
||||
await player._channel_entry_sequence(["4", "1"]) # digits fine, ENTER fails
|
||||
|
||||
# digits served by protocol; ENTER retried over ADB keyevent 66
|
||||
assert ("KEYCODE_4", "SHORT") in protocol.key_calls
|
||||
assert poller.digits == [] # digits were fine over the protocol
|
||||
assert poller.enter_calls == [True]
|
||||
assert served == []
|
||||
|
||||
async def test_legacy_fallback_when_both_transports_down(self, modules):
|
||||
player, served, _intents = make_player(modules)
|
||||
protocol = player._manager._protocol
|
||||
|
||||
Reference in new issue
Block a user