Changeset 3683:47e619d5ac45 in livinglogic.python.xist

Show
Ignore:
Timestamp:
01/23/09 23:12:28 (11 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Add tests for addattr.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • test/test_xist_basics.py

    r3591 r3683  
    896896            xsc.add(xml.Attrs(lang="en")) 
    897897    assert e == html.p(xml.Attrs(lang="en")) 
     898 
     899 
     900def test_with_addattr(): 
     901    with xsc.build(): 
     902        with html.ul() as e: 
     903            with xsc.addattr("id"): 
     904                +xsc.Text("gurk") 
     905    assert e == html.ul(id="gurk") 
     906 
     907    with xsc.build(): 
     908        with html.ul() as e: 
     909            with xsc.addattr(html.ul.Attrs.id): 
     910                +xsc.Text("gurk") 
     911    assert e == html.ul(id="gurk")