Changeset 2819:4ec09a972efd in livinglogic.python.xist

Show
Ignore:
Timestamp:
07/30/07 16:23:18 (12 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Add tests for css pseudo-classes :only-child and -only-of-type.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • test/test_xfind.py

    r2812 r2819  
    362362    assert list(e.walknode(xfind.css("div:first-child + p"))) == [e[2]] 
    363363    assert list(e.walknode(xfind.css("*:first-child + p"))) == [e[2]] 
     364 
     365    e = xsc.Frag(html.span(html.b("hurz"), "gurk", html.em("hinz"), html.em("kunz")), html.em("hurz"), html.em("hinz"), "nix", html.i("kunz")) 
     366    assert list(e.walknode(xfind.css("*:only-of-type"))) == [e[0], e[0][0], e[4]] 
     367 
     368    e = xsc.Frag(html.span(html.b("hurz"), "gurk")) 
     369    assert list(e.walknode(xfind.css("*:only-child"))) == [e[0], e[0][0]]