-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Autoset routes and requests pathname prefixes (#165) * Inspect environment variables for host & port (#167) * Support for index page templating (#168) * Add support for config-aware relative paths (#172) * Add unit tests for index customization (#176) * Send status code of 1 when unit tests fail (#177)
- Loading branch information
Showing
9 changed files
with
484 additions
and
55 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,55 @@ | ||
named_app = """ | ||
library(dash) | ||
library(dashHtmlComponents) | ||
app <- Dash$new() | ||
app$title("Testing") | ||
app$layout(htmlDiv(list(htmlDiv(id='container',children='Hello Dash for R testing')))) | ||
app$run_server() | ||
""" | ||
|
||
app_with_template = """ | ||
library(dash) | ||
library(dashHtmlComponents) | ||
app <- Dash$new() | ||
string <- | ||
"<!DOCTYPE html> | ||
<html> | ||
<head> | ||
{%meta_tags%} | ||
<title>Testing Again</title> | ||
{%favicon%} | ||
{%css_tags%} | ||
</head> | ||
<body> | ||
{%app_entry%} | ||
<footer> | ||
{%config%} | ||
{%scripts%} | ||
</footer> | ||
</body> | ||
</html>" | ||
app$index_string(string) | ||
app$layout(htmlDiv(list(htmlDiv(id='container',children='Hello Dash for R testing')))) | ||
app$run_server() | ||
""" | ||
|
||
|
||
def test_rapp001r_with_appname(dashr): | ||
dashr.start_server(named_app) | ||
dashr.wait_for_text_to_equal( | ||
"#container", "Hello Dash for R testing", timeout=1 | ||
) | ||
assert dashr.find_element("title").get_attribute("text") == "Testing" | ||
|
||
|
||
def test_rapp002_r_with_template(dashr): | ||
dashr.start_server(app_with_template) | ||
dashr.wait_for_text_to_equal( | ||
"#container", "Hello Dash for R testing", timeout=1 | ||
) | ||
assert dashr.find_element("title").get_attribute("text") == "Testing Again" |
Oops, something went wrong.