Here are the examples of the python api bokeh.resources.CSSResources taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
4 Examples
3
Source : test_standalone.py
with MIT License
from rthorst
with MIT License
from rthorst
def test_file_html_handles_css_only_resources(self, mock_warn, test_plot):
css_resources = CSSResources(mode="relative", components=["bokeh"])
template = Template(" < head>{{ bokeh_css }} < /head> < body> < /body>")
output = bes.file_html(test_plot, (None, css_resources), "title", template=template)
html = encode_utf8(" < head>%s < /head> < body> < /body>" % css_resources.render_css())
assert output == html
@patch('bokeh.embed.bundle.warn')
3
Source : test_standalone.py
with MIT License
from rthorst
with MIT License
from rthorst
def test_file_html_provides_warning_if_no_js(self, mock_warn, test_plot):
css_resources = CSSResources()
bes.file_html(test_plot, (None, css_resources), "title")
mock_warn.assert_called_once_with(
'No Bokeh JS Resources provided to template. If required you will need to provide them manually.'
)
def test_file_html_title_is_escaped(self, test_plot):
3
Source : test_resources.py
with MIT License
from rthorst
with MIT License
from rthorst
def test_css_resources_default_mode_is_inline():
r = resources.CSSResources()
assert r.mode == "inline"
def test_inline_css_resources():
3
Source : test_resources.py
with MIT License
from rthorst
with MIT License
from rthorst
def test_inline_css_resources():
r = resources.CSSResources(mode="inline")
assert r.mode == "inline"
assert r.dev is False
assert len(r.css_raw) == 3
assert hasattr(r, 'js_raw') is False
assert r.messages == []
class TestResources(object):