~ubuntuone-pqm-team/cssselect/stable

« back to all changes in this revision

Viewing changes to cssselect/tests.py

  • Committer: Simon Sapin
  • Date: 2012-11-15 12:44:04 UTC
  • mfrom: (147.1.2)
  • Revision ID: git-v1:653a5a56793bcb9271589305e39da42b773ea973
Merge pull request #20 from sjp/master

Have :empty not match whitespace-only elements.

Show diffs side-by-side

added added

removed removed

Lines of Context:
344
344
        assert xpath('e:only-of-type') == (
345
345
            "e[last() = 1]")
346
346
        assert xpath('e:empty') == (
347
 
            "e[not(*) and not(normalize-space())]")
 
347
            "e[not(*) and not(string-length())]")
348
348
        assert xpath('e:EmPTY') == (
349
 
            "e[not(*) and not(normalize-space())]")
 
349
            "e[not(*) and not(string-length())]")
350
350
        assert xpath('e:root') == (
351
351
            "e[not(parent::*)]")
352
352
        assert xpath('e:hover') == (
575
575
        assert pcss('p:only-of-type') == ['paragraph']
576
576
        assert pcss('a:empty', 'a:EMpty') == ['name-anchor']
577
577
        assert pcss('li:empty') == [
578
 
            'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']
 
578
            'third-li', 'fourth-li', 'fifth-li', 'sixth-li']
579
579
        assert pcss(':root', 'html:root') == ['html']
580
580
        assert pcss('li:root', '* :root') == []
581
581
        assert pcss('*:contains("link")', ':CONtains("link")') == [