-
-
Notifications
You must be signed in to change notification settings - Fork 530
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure css_files are referenced from correct relative path (#3289)
* Ensure css_files are referenced from correct relative path * Add tests * Fix flake
- Loading branch information
1 parent
29b6b58
commit 51b8950
Showing
2 changed files
with
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
from panel.pane import Markdown | ||
from panel.reactive import ReactiveHTML | ||
from panel.template import BootstrapTemplate | ||
from panel.widgets import Button, Tabulator | ||
from panel.widgets import Button, Tabulator, Terminal | ||
|
||
|
||
def test_get_server(html_server_session): | ||
|
@@ -677,3 +677,31 @@ def test_server_component_custom_resources_with_subpath_and_prefix_relative_url( | |
r = requests.get(f"http://localhost:{port}/prefix/subpath/component") | ||
content = r.content.decode('utf-8') | ||
assert 'href="../components/panel.tests.test_server/CustomComponent/__css__/./assets/custom.css"' in content | ||
|
||
|
||
def test_server_component_css_with_prefix_relative_url(): | ||
component = Terminal() | ||
|
||
port = 6027 | ||
serve({'component': component}, port=port, threaded=True, show=False) | ||
|
||
# Wait for server to start | ||
time.sleep(1) | ||
|
||
r = requests.get(f"http://localhost:{port}/component") | ||
content = r.content.decode('utf-8') | ||
assert 'href="static/extensions/panel/bundled/terminal/[email protected]/css/xterm.css' in content | ||
|
||
|
||
def test_server_component_css_with_subpath_and_prefix_relative_url(): | ||
component = Terminal() | ||
|
||
port = 6028 | ||
serve({'/subpath/component': component}, port=port, threaded=True, show=False, prefix='prefix') | ||
|
||
# Wait for server to start | ||
time.sleep(1) | ||
|
||
r = requests.get(f"http://localhost:{port}/prefix/subpath/component") | ||
content = r.content.decode('utf-8') | ||
assert 'href="../static/extensions/panel/bundled/terminal/[email protected]/css/xterm.css' in content |