Beispiel #1
0
def test_render():
    e = Element('test content')
    output = render_element(e)

    assert '<html>' in output
    assert 'test content' in output
    assert '</html>' in output
    assert True
Beispiel #2
0
def render_element(element, ind=""):
    """
    call the render method of an element and return the results as a string
    """
    f = StringIO()
    element.render(f, ind)
    f.seek(0)
    output = f.read()
    return output  # we don't care about leading/trailing whitespace

    e = Element('test content')
Beispiel #3
0
def test_elappend():
    e = Element('test content')
    e.append('test')

    assert e.content == ['test content', 'test']
def test_elappend():
    e = Element('test content')
    e.append('test')
    assert e.content == ['test content', 'test']
Beispiel #5
0
def test_p():
    e = Element('test content')
    output = render_element(e)
    assert '<body>' in output
    assert '</body' in output
Beispiel #6
0
def test_body():
    e = Element('test content')
    output = render_element(e)
    assert '<p>' in output
    assert '</p>' in output