Exemple #1
0
def test_Meta():
    element = Meta(charset="UTF-8")  # noqa: E501
    with open('file14.html', 'w') as file1fh:
        element.render(file1fh)
    with open('file14.html', 'r') as filefh:
        rendered = filefh.read()
    assert '<meta charset="UTF-8"/>\n' == rendered  # noqa: E501
def test_step8():
    html_el = Html('test')
    f = StringIO()
    html_el.render(f)
    assert f.getvalue() == ('<!DOCTYPE html>\n<html>\n    test\n</html>\n')

    meta = Meta(charset="UTF-8")
    assert meta.attr == {'charset': 'UTF-8'}
    f = StringIO()
    meta.render(f)
    assert f.getvalue() == ('<meta charset="UTF-8" />\n')
 def test_render(self):
     p = Meta()
     f = StringIO()
     p.render(f)
     expected = "<meta charset=" + '"' + "UTF-8" + '"' + " /> \n"
     self.assertEqual(expected, f.getvalue())
Exemple #4
0
def test_meta():
    test = Meta()
    f = StringIO()
    test.render(f)
    assert f.getvalue() == '<meta />\n'