Here are the examples of the python api bokeh.embed.util._create_temp_doc taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
6 Examples
3
View Source File : test_util.py
License : MIT License
Project Creator : rthorst
License : MIT License
Project Creator : rthorst
def test_no_docs(self):
p1 = Model()
p2 = Model()
beu._create_temp_doc([p1, p2])
assert isinstance(p1.document, Document)
assert isinstance(p2.document, Document)
def test_top_level_same_doc(self):
3
View Source File : test_util.py
License : MIT License
Project Creator : rthorst
License : MIT License
Project Creator : rthorst
def test_top_level_same_doc(self):
d = Document()
p1 = Model()
p2 = Model()
d.add_root(p1)
d.add_root(p2)
beu._create_temp_doc([p1, p2])
assert isinstance(p1.document, Document)
assert p1.document is not d
assert isinstance(p2.document, Document)
assert p2.document is not d
assert p2.document == p1.document
def test_top_level_different_doc(self):
3
View Source File : test_util.py
License : MIT License
Project Creator : rthorst
License : MIT License
Project Creator : rthorst
def test_top_level_different_doc(self):
d1 = Document()
d2 = Document()
p1 = Model()
p2 = Model()
d1.add_root(p1)
d2.add_root(p2)
beu._create_temp_doc([p1, p2])
assert isinstance(p1.document, Document)
assert p1.document is not d1
assert isinstance(p2.document, Document)
assert p2.document is not d2
assert p2.document == p1.document
def test_child_docs(self):
3
View Source File : test_util.py
License : MIT License
Project Creator : rthorst
License : MIT License
Project Creator : rthorst
def test_child_docs(self):
d = Document()
p1 = Model()
p2 = SomeModelInTestObjects(child=Model())
d.add_root(p2.child)
beu._create_temp_doc([p1, p2])
assert isinstance(p1.document, Document)
assert p1.document is not d
assert isinstance(p2.document, Document)
assert p2.document is not d
assert isinstance(p2.child.document, Document)
assert p2.child.document is not d
assert p2.document == p1.document
assert p2.document == p2.child.document
class Test__dispose_temp_doc(object):
3
View Source File : test_util.py
License : MIT License
Project Creator : rthorst
License : MIT License
Project Creator : rthorst
def test_with_docs(self):
d1 = Document()
d2 = Document()
p1 = Model()
d1.add_root(p1)
p2 = SomeModelInTestObjects(child=Model())
d2.add_root(p2.child)
beu._create_temp_doc([p1, p2])
beu._dispose_temp_doc([p1, p2])
assert p1.document is d1
assert p2.document is None
assert p2.child.document is d2
def test_with_temp_docs(self):
3
View Source File : test_util.py
License : MIT License
Project Creator : rthorst
License : MIT License
Project Creator : rthorst
def test_with_temp_docs(self):
p1 = Model()
p2 = Model()
beu._create_temp_doc([p1, p2])
beu._dispose_temp_doc([p1, p2])
assert p1.document is None
assert p2.document is None
class Test__set_temp_theme(object):