Exemplo n.º 1
0
def test_html_insert_head_with_attributes():
    # ticket 72: .need() broken when <head> tag has attributes
    foo = Library('foo', '')
    x1 = Resource(foo, 'a.js')
    needed = NeededResources(resources=[x1])

    html = '<html><head profile="http://example.org">something</head></html>'
    assert needed.render_into_html(html) == '''\
Exemplo n.º 2
0
def test_html_insert_head_with_attributes():
    # ticket 72: .need() broken when <head> tag has attributes
    foo = Library('foo', '')
    x1 = Resource(foo, 'a.js')
    needed = NeededResources(resources=[x1])

    html = '<html><head profile="http://example.org">something</head></html>'
    assert needed.render_into_html(html) == '''\
Exemplo n.º 3
0
def test_html_insert():
    foo = Library('foo', '')
    x1 = Resource(foo, 'a.js')
    x2 = Resource(foo, 'b.css')
    y1 = Resource(foo, 'c.js', depends=[x1, x2])

    needed = NeededResources()
    needed.need(y1)

    html = "<html><head>something more</head></html>"

    # XXX where is extraneous space coming from? misguided attempt at
    # indentation?
    assert needed.render_into_html(html) == '''\
Exemplo n.º 4
0
def test_html_insert():
    foo = Library('foo', '')
    x1 = Resource(foo, 'a.js')
    x2 = Resource(foo, 'b.css')
    y1 = Resource(foo, 'c.js', depends=[x1, x2])

    needed = NeededResources()
    needed.need(y1)

    html = "<html><head>something more</head></html>"

    # XXX where is extraneous space coming from? misguided attempt at
    # indentation?
    assert needed.render_into_html(html) == '''\