bs4.tests.test_soup#

Tests of Beautiful Soup as a whole.

Module Contents#

Classes#

TestConstructor

TestOutput

TestWarnings

TestSelectiveParsing

TestNewTag

Test the BeautifulSoup.new_tag() method.

TestNewString

Test the BeautifulSoup.new_string() method.

TestPickle

TestEncodingConversion

class bs4.tests.test_soup.TestConstructor#

Bases: bs4.tests.SoupTest

test_short_unicode_input()#
test_embedded_null()#
test_exclude_encodings()#
test_custom_builder_class()#
test_parser_markup_rejection()#
test_cdata_list_attributes()#
test_replacement_classes()#
test_alternate_string_containers()#
class bs4.tests.test_soup.TestOutput#

Bases: bs4.tests.SoupTest

test_decode_xml_declaration(eventual_encoding, actual_encoding)#
test_decode_xml_declaration_with_missing_or_python_internal_eventual_encoding(eventual_encoding)#
test()#
class bs4.tests.test_soup.TestWarnings#

Bases: bs4.tests.SoupTest

_assert_warning(warnings, cls)#
_assert_no_parser_specified(w)#
test_warning_if_no_parser_specified()#
test_warning_if_parser_specified_too_vague()#
test_no_warning_if_explicit_parser_specified()#
test_parseOnlyThese_renamed_to_parse_only()#
test_fromEncoding_renamed_to_from_encoding()#
test_unrecognized_keyword_argument()#
test_resembles_filename_warning(extension)#
test_resembles_filename_no_warning(extension)#
test_url_warning_with_bytes_url()#
test_url_warning_with_unicode_url()#
test_url_warning_with_bytes_and_space()#
test_url_warning_with_unicode_and_space()#
class bs4.tests.test_soup.TestSelectiveParsing#

Bases: bs4.tests.SoupTest

test_parse_with_soupstrainer()#
class bs4.tests.test_soup.TestNewTag#

Bases: bs4.tests.SoupTest

Test the BeautifulSoup.new_tag() method.

test_new_tag()#
test_xml_tag_inherits_self_closing_rules_from_builder()#
test_tag_inherits_self_closing_rules_from_builder()#
class bs4.tests.test_soup.TestNewString#

Bases: bs4.tests.SoupTest

Test the BeautifulSoup.new_string() method.

test_new_string_creates_navigablestring()#
test_new_string_can_create_navigablestring_subclass()#
class bs4.tests.test_soup.TestPickle#

Bases: bs4.tests.SoupTest

test_normal_pickle()#
test_pickle_with_no_builder()#
class bs4.tests.test_soup.TestEncodingConversion#

Bases: bs4.tests.SoupTest

setup_method()#
test_ascii_in_unicode_out()#
test_unicode_in_unicode_out()#
test_utf8_in_unicode_out()#
test_utf8_out()#