"""Test enabled selectors.""" from .. import util class TestEnabled(util.TestCase): """Test enabled selectors.""" MARKUP = """
""" MAKRUP_NESTED = """ """ def test_enable_html5(self): """ Test enable in the HTML5 parser. `:any-link` Form elements that have `disabled`. Form elements that are children of a disabled `fieldset`, but not it's `legend`. """ self.assert_selector( self.MARKUP, ":enabled", ['1', '2', 'opt-enable'], flags=util.HTML5 ) def test_enable_lxml(self): """ Test enable in the `lxml` HTML parser. `:any-link` Form elements that have `disabled`. Form elements that are children of a disabled `fieldset`, but not it's `legend`. """ self.assert_selector( self.MARKUP, ":enabled", ['1', 'opt-enable'], flags=util.LXML_HTML ) def test_enable_python(self): """ Test enable in the built-in HTML parser. `:any-link` Form elements that have `disabled`. Form elements that are children of a disabled `fieldset`, but not it's `legend`. """ self.assert_selector( self.MARKUP, ":enabled", ['1', '2', 'opt-enable'], flags=util.PYHTML ) def test_enable_with_nested_disabled_form_html5(self): """Test enable in the HTML5 parser.""" self.assert_selector( self.MAKRUP_NESTED, ":enabled", ['1', '2', 'opt-enable', 'b', '3'], flags=util.HTML5 ) def test_enable_with_nested_disabled_form_lxml(self): """Test enable in the `lxml` HTML parser.""" self.assert_selector( self.MAKRUP_NESTED, ":enabled", ['1', 'opt-enable'], flags=util.LXML_HTML ) def test_enable_with_nested_disabled_form_python(self): """Test enable in the built-in HTML parser.""" self.assert_selector( self.MAKRUP_NESTED, ":enabled", ['1', '2', 'opt-enable', 'b', '3'], flags=util.PYHTML )