bokeh.embed.standalone.json_item

Here are the examples of the python api bokeh.embed.standalone.json_item taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

6 Examples 7

3 View Source File : test_standalone.py
License : MIT License
Project Creator : rthorst

    def test_doc_json(self, test_plot):
        out = bes.json_item(test_plot, target="foo")
        expected = list(standalone_docs_json([test_plot]).values())[0]
        assert out['doc'] == expected

    def test_doc_title(self, test_plot):

0 View Source File : test_standalone.py
License : MIT License
Project Creator : rthorst

    def test_with_target_id(self, test_plot):
        out = bes.json_item(test_plot, target="foo")
        assert out['target_id'] == "foo"

    def test_without_target_id(self, test_plot):

0 View Source File : test_standalone.py
License : MIT License
Project Creator : rthorst

    def test_without_target_id(self, test_plot):
        out = bes.json_item(test_plot)
        assert out['target_id'] == None

    def test_doc_json(self, test_plot):

0 View Source File : test_standalone.py
License : MIT License
Project Creator : rthorst

    def test_doc_title(self, test_plot):
        out = bes.json_item(test_plot, target="foo")
        assert out['doc']['title'] == ""

    def test_root_id(self, test_plot):

0 View Source File : test_standalone.py
License : MIT License
Project Creator : rthorst

    def test_root_id(self, test_plot):
        out = bes.json_item(test_plot, target="foo")
        assert out['doc']['roots']['root_ids'][0] == out['root_id']

    @patch('bokeh.embed.standalone.OutputDocumentFor')

0 View Source File : test_standalone.py
License : MIT License
Project Creator : rthorst

    def test_apply_theme(self, mock_OFD, test_plot):
        # the subsequent call inside ODF will fail since the model was never
        # added to a document. Ignoring that since we just want to make sure
        # ODF is called with the expected theme arg.
        try:
            bes.json_item(test_plot, theme="foo")
        except ValueError:
            pass
        mock_OFD.assert_called_once_with([test_plot], apply_theme="foo")


#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
#-----------------------------------------------------------------------------

class Test__title_from_models(object):