Ejemplo n.º 1
0
def test_can_bulk_create_and_is_sorted(tag_service, ):
    # Given
    tag_a = Tag(name="a")
    tag_b = Tag(name="b")
    tag_c = Tag(name="c")
    tag_service.create(tag_b)
    tags = [tag_a, tag_c]
    # When
    tag_service.bulk_create(tags)
    actual = tag_service.tags
    # Then
    assert actual == [tag_a, tag_b, tag_c]
Ejemplo n.º 2
0
def test_show():
    source = "https://github.com/MarcSkovMadsen/awesome-panel/blob/master/app.py"
    thumbnail = (
        "https://raw.githubusercontent.com/MarcSkovMadsen/awesome-panel/master/"
        "assets/images/thumbnails/awesome-panel-org.png")
    author = Author(
        name="panel",
        url="https://panel.pyviz.org/",
        github_url="https://github.com/holoviz/",
        github_avatar_url="https://avatars2.githubusercontent.com/u/51678735",
    )
    home_page_main = pn.pane.Markdown(name="Home")
    tags = [Tag(name="awesome")]
    home_page = Page(
        name="Home",
        author=author,
        description="The main page of the application",
        tags=tags,
        source_code_url=source,
        thumbnail_png_url=thumbnail,
        component=home_page_main,
    )

    reload_services = [
        ReloadService(component=GalleryPageComponent,
                      component_parameters={"page": home_page}),
        ReloadService(
            component=GalleryComponent,
            component_parameters={"pages": [home_page for i in range(0, 6)]},
        ),
    ]

    Designer(reload_services=reload_services).view.show()
Ejemplo n.º 3
0
def tag():
    return Tag(name="Panel")
Ejemplo n.º 4
0
"""In this module we create all tags"""
from awesome_panel.application.models import Tag

ALTERNATIVE = Tag(name="Alternatives")
APP = Tag(name="App")
APP_IN_GALLERY = Tag(name="App In Gallery")
ARTICLE = Tag(name="Article")
AWESOME_PANEL_ORG = Tag(name="Awesome-panel.org")
AWESOMEPANEL_EXPRESS = Tag(name="awesome_panel.express")
CODE = Tag(name="Code")
DEPLOYMENT = Tag(name="Deployment")
INSPIRATION = Tag(name="Inspiration")
FINANCE = Tag(name="Finance")
IMAGE_RECOGNITION = Tag(name="Image Recognition")
MACHINE_LEARNING = Tag(name="Machine Learning")
NLP = Tag(name="NLP")
SOCIAL = Tag(name="Social")
PANEL = Tag(name="Panel")
SISTER_SITES = Tag(name="Sister Sites")
TECHNICAL = Tag(name="Technical")
TUTORIAL = Tag(name="Tutorial")
VIDEO = Tag(name="Video")
VOILA = Tag(name="Voila")
VTK = Tag(name="VTK")

TAGS = [
    ALTERNATIVE,
    APP,
    APP_IN_GALLERY,
    ARTICLE,
    AWESOMEPANEL_EXPRESS,