예제 #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
예제 #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')
예제 #3
0
def test_elappend():
    e = Element('test content')
    e.append('test')

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