示例#1
0
def test_image_link_url(document, comm):
    """Tests the loading of a image from a url"""
    url = 'https://file-examples-com.github.io/uploads/2017/10/file_example_PNG_500kB.png'

    image_pane = PNG(url, embed=False, link_url="http://anaconda.org")
    model = image_pane.get_root(document, comm)

    assert model.text.startswith('<a href="http://anaconda.org"')
示例#2
0
def test_image_alt_text(document, comm):
    """Tests the loading of a image from a url"""
    url = 'https://file-examples-com.github.io/uploads/2017/10/file_example_PNG_500kB.png'

    image_pane = PNG(url, embed=False, alt_text="Some alt text")
    model = image_pane.get_root(document, comm)

    assert 'alt="Some alt text"' in model.text
示例#3
0
def test_image_link_url(document, comm):
    """Tests the loading of a image from a url"""
    url = 'https://raw.githubusercontent.com/holoviz/panel/master/doc/_static/logo.png'

    image_pane = PNG(url, embed=False, link_url="http://anaconda.org")
    model = image_pane.get_root(document, comm)

    assert model.text.startswith('<a href="http://anaconda.org"')
示例#4
0
def test_image_alt_text(document, comm):
    """Tests the loading of a image from a url"""
    url = 'https://raw.githubusercontent.com/holoviz/panel/master/doc/_static/logo.png'

    image_pane = PNG(url, embed=False, alt_text="Some alt text")
    model = image_pane.get_root(document, comm)

    assert 'alt="Some alt text"' in model.text
示例#5
0
def test_image_link_url(document, comm):
    """Tests the loading of a image from a url"""
    url = 'https://upload.wikimedia.org/wikipedia/commons/7/71/' \
          '1700_CE_world_map.PNG'

    image_pane = PNG(url, embed=False, link_url="http://anaconda.org")
    model = image_pane.get_root(document, comm)

    assert model.text.startswith('<a href="http://anaconda.org"')
示例#6
0
def test_image_alt_text(document, comm):
    """Tests the loading of a image from a url"""
    url = 'https://upload.wikimedia.org/wikipedia/commons/7/71/' \
          '1700_CE_world_map.PNG'

    image_pane = PNG(url, embed=False, alt_text="Some alt text")
    model = image_pane.get_root(document, comm)

    assert 'alt="Some alt text"' in model.text