Example #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
Example #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
Example #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
Example #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=" " />'
Example #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>'
Example #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=" " />'
Example #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>'
Example #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=" " />'
Example #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>"
Example #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>'