fix(flr): treat MountCompletedSuccessfully as ready and use v1/downloads tokens

Lab 10.9 GET /v1/flrs/{id} returns a list with FlrSessionStatus, not a dict Status.
Download returns a path like v1/downloads/{id}, not a bare token.
This commit is contained in:
2026-09-21 12:18:09 -04:00
parent 38ba9c1b50
commit f9893b4956
4 changed files with 69 additions and 21 deletions
+19 -1
View File
@@ -1,12 +1,30 @@
from zerto_rewind_mcp.recover import download_token_from, session_id_from
from zerto_rewind_mcp.recover import (
download_token_from,
flr_row,
flr_status,
session_id_from,
)
def test_session_id_shapes():
assert session_id_from("abc") == "abc"
assert session_id_from({"sessionId": "s1"}) == "s1"
assert session_id_from({"Identifier": "s2"}) == "s2"
assert session_id_from({"FlrSessionIdentifier": "s3"}) == "s3"
def test_download_token_shapes():
assert download_token_from("tok") == "tok"
assert download_token_from({"downloadToken": "t2"}) == "t2"
assert download_token_from("v1/downloads/abc").startswith("v1/")
def test_flr_list_status():
payload = [
{
"FlrSessionStatus": "MountCompletedSuccessfully",
"FlrSessionIdentifier": "sess-1",
}
]
row = flr_row(payload)
assert flr_status(row).lower() == "mountcompletedsuccessfully"