Skip to content

Commit c3f7f3b

Browse files
committed
chore: make check-fix
1 parent 80bacdc commit c3f7f3b

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

tests/playwright/shiny/components/chat/append_status_message/app.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020

2121
with ui.layout_columns():
2222
with ui.div():
23-
ui.input_text("content", "Message Content", "Using model <code>llama3.2</code>")
23+
ui.input_text(
24+
"content", "Message Content", "Using model <code>llama3.2</code>"
25+
)
2426
ui.input_switch("content_is_html", "Raw HTML", True)
2527

2628
ui.input_radio_buttons("type", "Status type", choices=["dynamic", "static"])
@@ -41,5 +43,4 @@ async def send_status_message():
4143
if input.content_is_html.get():
4244
content = ui.HTML(content)
4345

44-
await chat.append_status_message(content, type = input.type())
45-
46+
await chat.append_status_message(content, type=input.type())

tests/playwright/shiny/components/chat/append_status_message/test_chat_append_status_message.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,30 @@ def test_validate_chat_basic(page: Page, local_app: ShinyAppProc) -> None:
2929
expect(chat.loc_latest_message).to_have_attribute("content_type", "html")
3030
expect(chat.loc_latest_message).to_have_attribute("type", "dynamic")
3131

32-
3332
# Send a status message that updates the original message
3433
content.set("Using model <code>phi4</code>")
3534
submit.click()
3635
chat.expect_latest_message("Using model phi4")
3736
expect(chat.loc_latest_message).to_have_attribute("content_type", "html")
3837
expect(chat.loc_latest_message).to_have_attribute("type", "dynamic")
3938

40-
4139
# Send a new status message that is static (doesn't overwrite previous message)
42-
html_message='<div class="alert alert-warning">Lost connection with provider.</div>'
40+
html_message = (
41+
'<div class="alert alert-warning">Lost connection with provider.</div>'
42+
)
4343
content.set(html_message)
4444
status_type.set("static")
4545
submit.click()
4646
chat.expect_latest_message("Lost connection with provider.")
4747
expect(chat.loc_latest_message).to_have_attribute("content_type", "html")
4848
expect(chat.loc_latest_message).to_have_attribute("type", "static")
49-
expect(chat.loc_latest_message.locator("> :first-child")).to_have_class("alert alert-warning")
49+
expect(chat.loc_latest_message.locator("> :first-child")).to_have_class(
50+
"alert alert-warning"
51+
)
5052
# previous status message is still there
51-
expect(chat.loc_messages.locator("> :nth-last-child(2)")).to_have_text("Using model phi4")
53+
expect(chat.loc_messages.locator("> :nth-last-child(2)")).to_have_text(
54+
"Using model phi4"
55+
)
5256

5357
# Now another message as raw text
5458
content.set("Using model <code>deepseek-r1</code>")
@@ -66,7 +70,6 @@ def test_validate_chat_basic(page: Page, local_app: ShinyAppProc) -> None:
6670
expect(chat.loc_latest_message).to_have_attribute("content_type", "html")
6771
expect(chat.loc_latest_message).to_have_attribute("type", "dynamic")
6872

69-
7073
chat.set_user_input("Hello")
7174
chat.send_user_input()
7275
chat.expect_latest_message("You said: Hello")
@@ -75,4 +78,6 @@ def test_validate_chat_basic(page: Page, local_app: ShinyAppProc) -> None:
7578
chat.expect_latest_message("Disconnecting. Goodbye!")
7679
expect(chat.loc_latest_message).to_have_attribute("content_type", "html")
7780
expect(chat.loc_latest_message).to_have_attribute("type", "dynamic")
78-
expect(chat.loc_messages.locator("> :nth-last-child(4)")).to_have_text("Using model deepseek-r1")
81+
expect(chat.loc_messages.locator("> :nth-last-child(4)")).to_have_text(
82+
"Using model deepseek-r1"
83+
)

0 commit comments

Comments
 (0)