bs4.tests.test_pageelement#

Tests of the bs4.element.PageElement class

Module Contents#

Classes#

TestEncoding

Test the ability to encode objects into strings.

TestFormatters

Test the formatting feature, used by methods like decode() and

TestPersistence

Testing features like pickle and deepcopy.

class bs4.tests.test_pageelement.TestEncoding#

Bases: bs4.tests.SoupTest

Test the ability to encode objects into strings.

test_unicode_string_can_be_encoded()#
test_tag_containing_unicode_string_can_be_encoded()#
test_encoding_substitutes_unrecognized_characters_by_default()#
test_encoding_can_be_made_strict()#
test_decode_contents()#
test_encode_contents()#
test_encode_deeply_nested_document()#
test_deprecated_renderContents()#
test_repr()#
class bs4.tests.test_pageelement.TestFormatters#

Bases: bs4.tests.SoupTest

Test the formatting feature, used by methods like decode() and prettify(), and the formatters themselves.

test_default_formatter_is_minimal()#
test_formatter_html()#
test_formatter_html5()#
test_formatter_minimal()#
test_formatter_null()#
test_formatter_custom()#
test_formatter_is_run_on_attribute_values()#
test_formatter_skips_script_tag_for_html_documents()#
test_formatter_skips_style_tag_for_html_documents()#
test_prettify_leaves_preformatted_text_alone()#
test_prettify_handles_nested_string_literal_tags()#
test_prettify_accepts_formatter_function()#
test_prettify_outputs_unicode_by_default()#
test_prettify_can_encode_data()#
test_html_entity_substitution_off_by_default()#
test_encoding_substitution()#
test_encoding_substitution_doesnt_happen_if_tag_is_strained()#
class bs4.tests.test_pageelement.TestPersistence#

Bases: bs4.tests.SoupTest

Testing features like pickle and deepcopy.

setup_method()#
test_pickle_and_unpickle_identity()#
test_deepcopy_identity()#
test_copy_deeply_nested_document()#
test_copy_preserves_encoding()#
test_copy_preserves_builder_information()#
test_unicode_pickle()#
test_copy_navigablestring_is_not_attached_to_tree()#
test_copy_navigablestring_subclass_has_same_type()#
test_copy_entire_soup()#
test_copy_tag_copies_contents()#