mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-14 04:55:07 +00:00
fix(remote): return session cache for device-code and cache-only logins
Answered login prompts and uploaded cache now count as client auth; the client closes on exit and keeps the remote session alive during long downloads.
This commit is contained in:
@@ -94,3 +94,16 @@ def test_status_setter() -> None:
|
||||
bridge = InputBridge()
|
||||
bridge.status = AuthStatus.AUTHENTICATED
|
||||
assert bridge.status is AuthStatus.AUTHENTICATED
|
||||
|
||||
|
||||
def test_answered_only_after_an_accepted_response() -> None:
|
||||
bridge = InputBridge()
|
||||
assert bridge.submit_response("early") is False
|
||||
assert bridge.answered is False
|
||||
worker = threading.Thread(target=bridge.request_input, args=("code?",))
|
||||
worker.start()
|
||||
while bridge.status != AuthStatus.PENDING_INPUT:
|
||||
time.sleep(0.01)
|
||||
assert bridge.submit_response("CODE") is True
|
||||
worker.join(timeout=2)
|
||||
assert bridge.answered is True
|
||||
|
||||
Reference in New Issue
Block a user