Changeset 2710:26fab3a32d4a in livinglogic.python.xist

Show
Ignore:
Timestamp:
06/22/07 17:43:29 (12 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Don't allow Attrs dicts in append() (and +).

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • src/ll/xist/xsc.py

    r2706 r2710  
    6969    """ 
    7070    if isinstance(value, Node): 
     71        if isinstance(value, Attrs): 
     72            raise TypeError("cannot convert %r" % value) 
    7173        # we don't have to turn an Attr into a Frag, because this will be done once the Attr is put back into the tree 
    7274        return value 
  • test/test_xist.py

    r2709 r2710  
    6060        node.append((5, 6)) 
    6161        check_lenunicode(node, 6, u"123456") 
     62        node.append(html.p.Attrs.id(7)) 
     63        check_lenunicode(node, 7, u"1234567") 
     64        py.test.raises(TypeError, node.append, xml.Attrs(lang="de")) 
    6265 
    6366 
     
    843846    assert e == html.p(1) 
    844847 
     848    with html.p() as e: 
     849        py.test.raises(TypeError, xml.Attrs(lang="de").__pos__) 
     850 
    845851    with xsc.Frag() as e: 
    846852        +xsc.Text(1)