Esempio n. 1
0
def test_compound():
    output = '<b>Hey <i>you</i>!</b>'
    assert str(html.b('Hey ', html.i('you'), '!')) == output
    assert str(html.b()('Hey ')(html.i()('you'))('!')) == output
    inner = html('Hey ', html.i('you'), '!')
    assert html.str(inner) == 'Hey <i>you</i>!'
    assert str(inner) == 'Hey <i>you</i>!'
    assert str(html.b(inner)) == output
Esempio n. 2
0
def test_compound():
    output = '<b>Hey <i>you</i>!</b>'
    assert str(html.b('Hey ', html.i('you'), '!')) == output
    assert str(html.b()('Hey ')(html.i()('you'))('!')) == output
    inner = html('Hey ', html.i('you'), '!')
    assert html.str(inner) == 'Hey <i>you</i>!'
    assert str(inner) == 'Hey <i>you</i>!'
    assert str(html.b(inner)) == output
Esempio n. 3
0
def test_compound():
    output = "<b>Hey <i>you</i>!</b>"
    assert str(html.b("Hey ", html.i("you"), "!")) == output
    assert str(html.b()("Hey ")(html.i()("you"))("!")) == output
    inner = html("Hey ", html.i("you"), "!")
    assert html.str(inner) == "Hey <i>you</i>!"
    assert str(inner) == "Hey <i>you</i>!"
    assert str(html.b(inner)) == output
Esempio n. 4
0
def test_none():
    assert html.str(None) == ''
    assert str(html.b(class_=None)('hey')) == '<b>hey</b>'
    assert str(html.b(class_=' ')(None)) == '<b class=" " />'
Esempio n. 5
0
def test_quote():
    assert html.quote('<hey>!') == '&lt;hey&gt;!'
    assert html.quote(uni_value) == uni_value.encode('utf-8')
    assert html.quote(None) == ''
    assert html.str(None) == ''
    assert str(html.b('<hey>')) == '<b>&lt;hey&gt;</b>'
Esempio n. 6
0
def test_none():
    assert html.str(None) == ''
    assert str(html.b(class_=None)('hey')) == '<b>hey</b>'
    assert str(html.b(class_=' ')(None)) == '<b class=" " />'
Esempio n. 7
0
def test_quote():
    assert html.quote('<hey>!') == '&lt;hey&gt;!'
    assert html.quote(uni_value) == str_value
    assert html.quote(None) == ''
    assert html.str(None) == ''
    assert str(html.b('<hey>')) == '<b>&lt;hey&gt;</b>'
Esempio n. 8
0
def test_none():
    assert html.str(None) == ""
    assert str(html.b(class_=None)("hey")) == "<b>hey</b>"
    assert str(html.b(class_=" ")(None)) == '<b class=" " />'
Esempio n. 9
0
def test_quote():
    assert html.quote("<hey>!") == "&lt;hey&gt;!"
    assert html.quote(uni_value) == str_value
    assert html.quote(None) == ""
    assert html.str(None) == ""
    assert str(html.b("<hey>")) == "<b>&lt;hey&gt;</b>"
Esempio n. 10
0
def test_quote():
    assert html.quote('<hey>!') == '&lt;hey&gt;!'
    assert html.quote(uni_value) == uni_value.encode('utf-8')
    assert html.quote(None) == ''
    assert html.str(None) == ''
    assert str(html.b('<hey>')) == '<b>&lt;hey&gt;</b>'