-
-
Notifications
You must be signed in to change notification settings - Fork 531
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f94a14
commit a42b59c
Showing
4 changed files
with
84 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import panel as pn | ||
|
||
button = pn.widgets.Button(name='Click') | ||
|
||
string = pn.pane.Str(object=0, css_classes=['string']) | ||
|
||
def cb(event): | ||
string.object += 1 | ||
|
||
button.on_click(cb) | ||
|
||
pn.Row(button, string).servable() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import sys | ||
import time | ||
|
||
import pytest | ||
|
||
pytestmark = pytest.mark.ui | ||
|
||
not_windows = pytest.mark.skipif(sys.platform=='win32', reason="Does not work on Windows") | ||
|
||
@not_windows | ||
def test_jupyter_server(page, jupyter_server): | ||
port = jupyter_server.args[-1] | ||
|
||
page.goto(f"http://localhost:{port}/panel-preview/render/app.py") | ||
|
||
assert page.text_content('.bk.string') == '0' | ||
|
||
page.click('.bk.bk-btn') | ||
time.sleep(0.1) | ||
|
||
assert page.text_content('.bk.string') == '1' | ||
|
||
page.click('.bk.bk-btn') | ||
time.sleep(0.1) | ||
|
||
assert page.text_content('.bk.string') == '2' | ||
|
||
@not_windows | ||
def test_jupyter_server_kernel_error(page, jupyter_server): | ||
port = jupyter_server.args[-1] | ||
|
||
page.goto(f"http://localhost:{port}/panel-preview/render/app.py?kernel=blah") | ||
|
||
assert page.text_content('h1') == 'Kernel Error: No such kernel blah' | ||
|
||
page.select_option('select#kernel-select', 'python3') | ||
|
||
assert page.text_content('.bk.string') == '0' | ||
page.click('.bk.bk-btn') | ||
time.sleep(0.1) | ||
|
||
assert page.text_content('.bk.string') == '1' |