Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions music_assistant_models/setup_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class SetupFlowStep(DataClassDictMixin):
last_step: bool | None = None
# url [EXTERNAL]: url the user must open (e.g. an OAuth authorize url)
url: str | None = None
# copy_text [EXTERNAL]: optional value that the client may copy to the clipboard
copy_text: str | None = None
# progress_text [PROGRESS]: status slug/message, resolved from the translations at serialization
progress_text: str | None = None
# progress [PROGRESS]: optional completion fraction between 0 and 1
Expand Down
4 changes: 3 additions & 1 deletion tests/test_setup_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,19 @@ def test_form_step_shape() -> None:


def test_external_step_shape() -> None:
"""An EXTERNAL step carries the url to open and an optional deadline."""
"""An EXTERNAL step carries the url to open, copyable text and an optional deadline."""
step = SetupFlowStep(
flow_id="f",
step_id="oauth",
type=FlowStepType.EXTERNAL,
url="https://example.test/authorize",
copy_text="123456",
expires_at=1234.5,
)
d = step.to_dict()
assert d["type"] == "external"
assert d["url"] == "https://example.test/authorize"
assert d["copy_text"] == "123456"
assert d["expires_at"] == 1234.5


Expand Down