File: test_namespace.py

package info (click to toggle)
python-trame-server 3.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 480 kB
  • sloc: python: 4,075; javascript: 5; sh: 4; makefile: 3
file content (16 lines) | stat: -rw-r--r-- 488 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from trame.app import get_server
from trame.ui.html import DivLayout
from trame.widgets import html


def test_namespace_template():
    server = get_server("test_namespace_template")
    child_server = server.create_child_server(prefix="child_")
    child_server.state.a = 10

    layout = DivLayout(child_server)
    with layout:
        html.Div("{{ a }}")

    assert layout.html == "<div >\n<div >\n{{ child_a }}\n</div>\n</div>"
    assert child_server.translator("a") == "child_a"