[Bug 1719008] Review Request: python-soupsieve - CSS selector library

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/show_bug.cgi?id=1719008



--- Comment #14 from Miro Hrončok <mhroncok@xxxxxxxxxx> ---
=================================== FAILURES
===================================
________________________ TestDefined.test_defined_xhtml
________________________
self = <tests.test_level4.test_defined.TestDefined
testMethod=test_defined_xhtml>
    def test_defined_xhtml(self):
        """Test defined XHTML."""

        markup = """
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
            "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>
        <html lang="en" xmlns="http://www.w3.org/1999/xhtml";>
        <head>
        </head>
        <body>
        <div id="0"></div>
        <div-custom id="1"></div-custom>
        <prefix:div id="2"></prefix:div>
        <!--
        lxml or BeautifulSoup seems to strip away the prefix.
        This is most likely because prefix with no namespace is not really
valid.
        XML does allow colons in names, but encourages them to be used for
namespaces.
        Do we really care that the prefix is wiped out in XHTML if there is no
namespace?
        If we do, we should look into this in the future.
        -->
        <prefix:div-custom id="3"></prefix:div-custom>
        </body>
        </html>
        """

        self.assert_selector(
            markup,
            'body :defined',
            ['0', '2'],  # We should get 3, but we don't for reasons stated
above.
>           flags=util.XHTML
        )
tests/test_level4/test_defined.py:63: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/util.py:142: in assert_selector
    self.assertEqual(sorted(ids), sorted(expected_ids))
E   AssertionError: Lists differ: [u'0', u'1', u'2'] != [u'0', u'2']
E   
E   First differing element 1:
E   u'1'
E   u'2'
E   
E   First list contains 1 additional elements.
E   First extra element 2:
E   u'2'
E   
E   - [u'0', u'1', u'2']
E   ?        ------
E   
E   + [u'0', u'2']
----------------------------- Captured stdout call
-----------------------------
----Running Selector Test----
(u'PATTERN: ', u'body :defined')
## PARSING: u'body :defined'
TOKEN: 'tag' --> u'body' at position 0
TOKEN: 'combine' --> u' ' at position 4
TOKEN: 'pseudo_class' --> u':defined' at position 5
## END PARSING
(u'\n====PARSER: ', u'xml')
(u'TAG: ', 'div')
(u'TAG: ', 'div-custom')
(u'TAG: ', 'div')
_____________________ TestDefinedQuirks.test_defined_xhtml
_____________________
self = <tests.test_level4.test_defined.TestDefinedQuirks
testMethod=test_defined_xhtml>
    def test_defined_xhtml(self):
        """Test defined XHTML."""

        markup = """
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
            "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>
        <html lang="en" xmlns="http://www.w3.org/1999/xhtml";>
        <head>
        </head>
        <body>
        <div id="0"></div>
        <div-custom id="1"></div-custom>
        <prefix:div id="2"></prefix:div>
        <!--
BUILDSTDERR:         lxml or Beauerror: Bad exit status from
/var/tmp/rpm-tmp.8Xwbku (%check)
BUILDSTDERR:     Bad exit status from /var/tmp/rpm-tmp.8Xwbku (%check)
tifulSoup seems to strip away the prefix.
        This is most likely because prefix with no namespace is not really
valid.
        XML does allow colons in names, but encourages them to be used for
namespaces.
        Do we really care that the prefix is wiped out in XHTML if there is no
namespace?
        If we do, we should look into this in the future.
        -->
        <prefix:div-custom id="3"></prefix:div-custom>
        </body>
        </html>
        """

        self.assert_selector(
            markup,
            'body :defined',
            ['0', '2'],  # We should get 3, but we don't for reasons stated
above.
>           flags=util.XHTML
        )
tests/test_level4/test_defined.py:63: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/util.py:142: in assert_selector
    self.assertEqual(sorted(ids), sorted(expected_ids))
E   AssertionError: Lists differ: [u'0', u'1', u'2'] != [u'0', u'2']
E   
E   First differing element 1:
E   u'1'
E   u'2'
E   
E   First list contains 1 additional elements.
E   First extra element 2:
E   u'2'
E   
E   - [u'0', u'1', u'2']
E   ?        ------
E   
E   + [u'0', u'2']
----------------------------- Captured stdout call
-----------------------------
----Running Selector Test----
(u'PATTERN: ', u'body :defined')
## QUIRKS MODE: Throwing out the spec!
## PARSING: u'body :defined'
TOKEN: 'tag' --> u'body' at position 0
TOKEN: 'combine' --> u' ' at position 4
TOKEN: 'pseudo_class' --> u':defined' at position 5
## END PARSING
(u'\n====PARSER: ', u'xml')
(u'TAG: ', 'div')
(u'TAG: ', 'div-custom')
(u'TAG: ', 'div')
=============================== warnings summary
===============================
tests/test_api.py::TestSoupSieve::test_comments
  /builddir/build/BUILD/soupsieve-1.9.1/tests/test_api.py:37:
DeprecationWarning: 'comments' is deprecated. 'comments' is not related to CSS
selectors and will be removed in the future.
    comments = [sv_util.ustr(c).strip() for c in sv.comments(soup)]
tests/test_api.py::TestSoupSieve::test_compiled_comments
  /builddir/build/BUILD/soupsieve-1.9.1/tests/test_api.py:88:
DeprecationWarning: 'comments' is deprecated. 'comments' is not related to CSS
selectors and will be removed in the future.
    comments = [sv_util.ustr(c).strip() for c in pattern.comments(soup)]
tests/test_api.py::TestSoupSieve::test_compiled_icomments
  /builddir/build/BUILD/soupsieve-1.9.1/tests/test_api.py:113:
DeprecationWarning: 'icomments' is deprecated. 'icomments' is not related to
CSS selectors and will be removed in the future.
    comments = [sv_util.ustr(c).strip() for c in pattern.icomments(soup,
limit=2)]
tests/test_api.py::TestSoupSieve::test_icomments
  /builddir/build/BUILD/soupsieve-1.9.1/tests/test_api.py:61:
DeprecationWarning: 'icomments' is deprecated. 'icomments' is not related to
CSS selectors and will be removed in the future.
    comments = [sv_util.ustr(c).strip() for c in sv.icomments(soup, limit=2)]
tests/test_api.py::TestInvalid::test_invalid_type_input_comments
tests/test_api.py::TestInvalidQuirks::test_invalid_type_input_comments
  /builddir/build/BUILD/soupsieve-1.9.1/tests/test_api.py:704:
DeprecationWarning: 'comments' is deprecated. 'comments' is not related to CSS
selectors and will be removed in the future.
    sv.comments('div', "not a tag", flags=flags)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
== 2 failed, 645 passed, 2 skipped, 1 deselected, 6 warnings in 5.95 seconds
===

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are always notified about changes to this product and component
_______________________________________________
package-review mailing list -- package-review@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to package-review-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/package-review@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite Conditions]     [KDE Users]

  Powered by Linux