Changeset 4533:35aca9b50120 in livinglogic.python.xist for test/test_ul4.py

Show
Ignore:
Timestamp:
08/09/11 17:40:31 (8 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Tags:
rel-3-24
Message:

Replace ll.xist.xsc.AttrProcInst? with ll.xist.xsc.AttrElement?.

This makes it possible to have a useful output for the new element outside of
attributes.

Make ll.xist.ns.ul4.attr_if an AttrElement? subclass.

Remove ll.xist.ns.ul4.attr_ifnn.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • test/test_ul4.py

    r4524 r4533  
    1717 
    1818from ll import ul4c, color, misc 
     19from ll.xist.ns import html, ul4 
    1920 
    2021 
     
    19271928    t = universaltemplate() 
    19281929    t.javasource() 
     1930 
     1931 
     1932@py.test.mark.ul4 
     1933def test_attr_if(): 
     1934    cond = ul4.attr_if(html.a("gu'\"rk"), cond="cond") 
     1935 
     1936    s = html.div(class_=cond).conv().string() 
     1937    for r in all_renderers: 
     1938        yield eq, u'<div></div>', r(s, cond=False) 
     1939        yield eq, u'''<div class="gu'&quot;rk"></div>''', r(s, cond=True) 
     1940 
     1941    s = html.div(class_=(cond, "hurz")).conv().string() 
     1942    for r in all_renderers: 
     1943        yield eq, u'<div class="hurz"></div>', r(s, cond=False) 
     1944        yield eq, u'''<div class="gu'&quot;rkhurz"></div>''', r(s, cond=True) 
     1945 
     1946    s = cond.conv().string() 
     1947    for r in all_renderers: 
     1948        yield eq, u'', r(s, cond=False) 
     1949        yield eq, u'''<a>gu'"rk</a>''', r(s, cond=True)