示例#1
0
def test_can_set_icon_on_button():
    # When
    button = AwesomeButton(name="Click Me", )
    # When
    button.icon = _icon()
    # Then
    assert isinstance(button._bk_icon, _BkIcon)
    assert button._bk_icon is button.icon._bk_icon
示例#2
0
def _icon_button(icon=None) -> AwesomeButton:
    if not icon:
        icon = _icon()
    return AwesomeButton(name="Click Me", icon=icon)
示例#3
0
def test_can_construct_button_without_icon():
    # When
    button = AwesomeButton(name="Click Me", )
    # Then
    assert button.icon is None
    assert button._bk_icon is None
示例#4
0
import awesome_panel_extensions
import panel as pn
from awesome_panel_extensions.widgets.button import AwesomeButton

button = AwesomeButton()


def view():
    pn.Column(pn.pane.Markdown("Hello World"), )


PREFIX = "sub/subsub"
ROUTES = {"": view}

pn.serve(ROUTES, port=5007, prefix=PREFIX)