class documentation

class TestCSSSelectors(SoupTest): (source)

View In Hierarchy

Test basic CSS selector functionality. This functionality is implemented in soupsieve, which has a much more comprehensive test suite, so this is basically an extra check that soupsieve works as expected.

Method assert_select_multiple Undocumented
Method assert_selects Make sure that the given tags have the correct text.
Method setup_method Undocumented
Method test_a_bunch_of_emptys Undocumented
Method test_adjacent_sibling_selector Undocumented
Method test_attribute_contains Undocumented
Method test_attribute_endswith Undocumented
Method test_attribute_equals Undocumented
Method test_attribute_exact_or_hypen Undocumented
Method test_attribute_exists Undocumented
Method test_attribute_startswith Undocumented
Method test_attribute_tilde Undocumented
Method test_bad_id Undocumented
Method test_child_selector Undocumented
Method test_child_selector_id Undocumented
Method test_class_mismatched_tag Undocumented
Method test_class_one Undocumented
Method test_dangling_combinator Undocumented
Method test_dashed_tag_text Undocumented
Method test_general_sibling_selector Undocumented
Method test_header_tags Undocumented
Method test_id_child_selector_nth_of_type Undocumented
Method test_invalid_multiple_select Undocumented
Method test_invalid_tag Undocumented
Method test_items_in_id Undocumented
Method test_limit Undocumented
Method test_multi_class_selection Undocumented
Method test_multi_class_support Undocumented
Method test_multiple_select Undocumented
Method test_multiple_select_attrs Undocumented
Method test_multiple_select_direct_descendant_and_tags Undocumented
Method test_multiple_select_duplicated Undocumented
Method test_multiple_select_ids Undocumented
Method test_multiple_select_indirect_descendant Undocumented
Method test_multiple_select_nested Undocumented
Method test_multiple_select_sibling Undocumented
Method test_multiple_select_tag_and_direct_descendant Undocumented
Method test_multiple_select_with_more_space Undocumented
Method test_multiple_select_with_no_space Undocumented
Method test_nth_of_type Undocumented
Method test_nth_of_type_direct_descendant Undocumented
Method test_one_id Undocumented
Method test_one_tag_many Undocumented
Method test_one_tag_one Undocumented
Method test_overspecified_child_id Undocumented
Method test_quoted_space_in_selector_name Undocumented
Method test_select_dashed_by_id Undocumented
Method test_select_dashed_matches_find_all Undocumented
Method test_select_dashed_tag_ids Undocumented
Method test_select_duplicate_elements Undocumented
Method test_select_on_element Undocumented
Method test_select_one_returns_none_if_no_match Undocumented
Method test_sibling_combinator_wont_select_same_tag_twice Undocumented
Method test_tag_in_tag_many Undocumented
Method test_tag_in_tag_one Undocumented
Method test_tag_no_match Undocumented
Method test_unsupported_pseudoclass Undocumented
Constant HTML Undocumented

Inherited from SoupTest:

Method assert_selects_ids Make sure that the given tags have the correct IDs.
Method assert_soup Parse some markup using Beautiful Soup and verify that the output markup is as expected.
Method assertConnectedness Ensure that next_element and previous_element are properly set for all descendants of the given element.
Method document_for Turn an HTML fragment into a document.
Method linkage_validator Ensure proper linkage throughout the document.
Method soup Build a Beautiful Soup object from markup.
Property default_builder Undocumented
def assert_select_multiple(self, *tests): (source)

Undocumented

def assert_selects(self, selector, expected_ids, **kwargs): (source)

Make sure that the given tags have the correct text. This is used in tests that define a bunch of tags, each containing a single string, and then select certain strings by some mechanism.

def setup_method(self): (source)

Undocumented

def test_a_bunch_of_emptys(self): (source)

Undocumented

def test_adjacent_sibling_selector(self): (source)

Undocumented

def test_attribute_contains(self): (source)

Undocumented

def test_attribute_endswith(self): (source)

Undocumented

def test_attribute_equals(self): (source)

Undocumented

def test_attribute_exact_or_hypen(self): (source)

Undocumented

def test_attribute_exists(self): (source)

Undocumented

def test_attribute_startswith(self): (source)

Undocumented

def test_attribute_tilde(self): (source)

Undocumented

def test_bad_id(self): (source)

Undocumented

def test_child_selector(self): (source)

Undocumented

def test_child_selector_id(self): (source)

Undocumented

def test_class_mismatched_tag(self): (source)

Undocumented

def test_class_one(self): (source)

Undocumented

def test_dangling_combinator(self): (source)

Undocumented

def test_dashed_tag_text(self): (source)

Undocumented

def test_general_sibling_selector(self): (source)

Undocumented

def test_header_tags(self): (source)

Undocumented

def test_id_child_selector_nth_of_type(self): (source)

Undocumented

def test_invalid_multiple_select(self): (source)

Undocumented

def test_invalid_tag(self): (source)

Undocumented

def test_items_in_id(self): (source)

Undocumented

def test_limit(self): (source)

Undocumented

def test_multi_class_selection(self): (source)

Undocumented

def test_multi_class_support(self): (source)

Undocumented

def test_multiple_select(self): (source)

Undocumented

def test_multiple_select_attrs(self): (source)

Undocumented

def test_multiple_select_direct_descendant_and_tags(self): (source)

Undocumented

def test_multiple_select_duplicated(self): (source)

Undocumented

def test_multiple_select_ids(self): (source)

Undocumented

def test_multiple_select_indirect_descendant(self): (source)

Undocumented

def test_multiple_select_nested(self): (source)

Undocumented

def test_multiple_select_sibling(self): (source)

Undocumented

def test_multiple_select_tag_and_direct_descendant(self): (source)

Undocumented

def test_multiple_select_with_more_space(self): (source)

Undocumented

def test_multiple_select_with_no_space(self): (source)

Undocumented

def test_nth_of_type(self): (source)

Undocumented

def test_nth_of_type_direct_descendant(self): (source)

Undocumented

def test_one_id(self): (source)

Undocumented

def test_one_tag_many(self): (source)

Undocumented

def test_one_tag_one(self): (source)

Undocumented

def test_overspecified_child_id(self): (source)

Undocumented

def test_quoted_space_in_selector_name(self): (source)

Undocumented

def test_select_dashed_by_id(self): (source)

Undocumented

def test_select_dashed_matches_find_all(self): (source)

Undocumented

def test_select_dashed_tag_ids(self): (source)

Undocumented

def test_select_duplicate_elements(self): (source)

Undocumented

def test_select_on_element(self): (source)

Undocumented

def test_select_one_returns_none_if_no_match(self): (source)

Undocumented

def test_sibling_combinator_wont_select_same_tag_twice(self): (source)

Undocumented

def test_tag_in_tag_many(self): (source)

Undocumented

def test_tag_in_tag_one(self): (source)

Undocumented

def test_tag_no_match(self): (source)

Undocumented

def test_unsupported_pseudoclass(self): (source)

Undocumented

Undocumented

Value
'''
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>The title</title>
<link rel="stylesheet" href="blah.css" type="text/css" id="l1">
...