Esempio n. 1
0
def test_nesting():
    assert matches(H.div(H.div(H.b("inner"))),
                   "<div><div><b>inner</b></div></div>")
    assert matches(H.div(H.b("hello"), H.i("there")),
                   "<div><b>hello</b><i>there</i></div>")
    assert matches(
        H.div([[[H.b("hello"), [H.i("there")]]]]),
        "<div><b>hello</b><i>there</i></div>",
    )
Esempio n. 2
0
 def error(self, message):
     print(H.i(message, style="color:red"))
Esempio n. 3
0
def test_inline():
    assert matches(H.inline("thing"), "thing")
    assert matches(H.inline("<b>hello</b>"), "&lt;b&gt;hello&lt;/b&gt;")
    assert matches(H.inline(H.b("hello"), H.i("there")),
                   "<b>hello</b><i>there</i>")
Esempio n. 4
0
def test_raw():
    assert matches(H.raw("thing"), "thing")
    assert matches(H.raw("<b>hello</b>"), "<b>hello</b>")
    assert matches(H.raw(H.b("hello"), H.i("there")),
                   "<b>hello</b><i>there</i>")
    assert matches(H.raw(H.b("<inner>")), "<b>&lt;inner&gt;</b>")
Esempio n. 5
0
def test_misc():
    assert matches(H.whimsy("cal"), "<whimsy>cal</whimsy>")
    assert H.div(H.b("hello")) == H.div(H.b("hello"))
    assert H.div(H.b("hello")) != H.div(H.i("hello"))
    assert isinstance(hash(H.div(H.div("yay!"))), int)
    assert repr(H.div("soupe")) == str(H.div("soupe"))