Exemple #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"')
Exemple #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
Exemple #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"')
Exemple #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
Exemple #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"')
Exemple #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