0
  :   ˆl–ßi~”Ši?u@µpÜ Å£’þ[Ë7 
ó p$| Zof¯ùÎÇÆÍ‚pÂËÊ Y    ‹      }TMsÓ0=Û¿bs©ì×8&f ¹1”)áÔé0Š½ŽEeÉH2¥ùï•,Ùqà’DÚ·«÷Þî†tAÅ
Cq!…6ð¼QTèJª&ƒ¯TëM­d·«÷°…¿:¦0!6iCÒ!ç‰³í4îÎ‡hÃVÜ ní	§°>p©BÄ%Ä�,;Ž9þi¥2ºyïá9Ž|EûiP˜µ(dÉÄÎÂ’—×HKTú–Ð%¹ƒ— $Í�ü,P}¢÷hÄ*Hf·d÷ÄZ’)±âÔ û¹Uä.g¢à]‰:9y7M¥H¡é”™.âhok^]Áæzu=‡läoS35
0TíÐ8Þ_d‰ùOoÞæƒ4¦?*i8³šÎT.—=¡…'<"/.À<¶(«¾ya{cÐÇVXÈ¦µÌ4Ì\vÕ‰Â0)ÈÀ<˜fÅ%�°VJª„„â–´�t×ºŽ`	RŒ´ßYâ$µþËŽNÐºiÍ£ÕcT‡ÎíÐÃ‹{TöÞ=:]âx™ñTRC3ø1ô0ƒ‚r¾¥Å½ªW”ë¾|˜Dtœgàjô$÷™W¼ÓurRgLñ@K?=P­˜ ü[?ó�îd1zÂ´3rå=œ{&™½\Eçèõ3óÓö}Úßø”cWGRã0|øß$)Ì§ñïÂN¼÷´f.EaW´ç`¡ÿ;¦Ïo‡o6*±‰%Ýr
'¾å(Jïm/+>æÐ^õÑÈ¸éÙ´/<ÒhY‹I˜¯ÔŸNå…ëã
ñ0Æ“ëE¼_Ä¯3È§(    C   ˆl–ßi~”d*eJe@¹q±\i¥1hß�þZqÖVnV_ŸoJ ?Ï„Àe¿Î_ŠI|¥�+Wé3ž¯ÍÌ ?÷     # -*- coding: utf-8 -*-
"""Tests of Beautiful Soup as a whole."""

from pdb import set_trace
import logging
import os
import pickle
import pytest
import sys
import tempfile

from bs4 import (
    BeautifulSoup,
    BeautifulStoneSoup,
    GuessedAtParserWarning,
    MarkupResemblesLocatorWarning,
    dammit,
)
from bs4.builder import (
    builder_registry,
    TreeBuilder,
    ParserRejectedMarkup,
)
from bs4.element import (
    Comment,
    SoupStrainer,
    Tag,
    NavigableString,
)

from . import (
    default_builder,
    LXML_PRESENT,
    SoupTest,
)
import warnings
    
class TestConstructor(SoupTest):

    def test_short_unicode_input(self):
        data = "<h1>Ã©Ã©</h1>"
        soup = self.soup(data)
        assert "Ã©Ã©" == soup.h1.string

    def test_embedded_null(self):
        data = "<h1>foo\0bar</h1>"
        soup = self.soup(data)
        assert "foo\0bar" == soup.h1.string

    def test_exclude_encodings(self):
        utf8_data = "RÃ¤ksmÃ¶rgÃ¥s".encode("utf-8")
        soup = self.soup(utf8_data, exclude_encodings=["utf-8"])
        assert "windows-1252" == soup.original_encoding

    def test_custom_builder_class(self):
        # Verify that you can pass in a custom Builder class and
        # it'll be instantiated with the appropriate keyword arguments.
        class Mock(object):
            def __init__(self, **kwargs):
                self.called_with = kwargs
                self.is_xml = True
                self.store_line_numbers = False
                self.cdata_list_attributes = []
                self.preserve_whitespace_tags = []
                self.string_containers = {}
            def initialize_soup(self, soup):
                pass
            def feed(self, markup):
                self.fed = markup
            def reset(self):
                pass
            def ignore(self, ignore):
                pass
            set_up_substitutions = can_be_empty_element = ignore
            def prepare_markup(self, *args, **kwargs):
                yield "prepared markup", "original encoding", "declared encoding", "contains replacement characters"
                
        kwargs = dict(
            var="value",
            # This is a deprecated BS3-era keyword argument, which
            # will be stripped out.
            convertEntities=True,
        )
        with warnings.catch_warnings(record=True):
            soup = BeautifulSoup('', builder=Mock, **kwargs)
        assert isinstance(soup.builder, Mock)
        assert dict(var="value") == soup.builder.called_with
        assert "prepared markup" == soup.builder.fed
        
        # You can also instantiate the TreeBuilder yourself. In this
        # case, that specific object is used and any keyword arguments
        # to the BeautifulSoup constructor are ignored.
        builder = Mock(**kwargs)
        with warnings.catch_warnings(record=True) as w:
            soup = BeautifulSoup(
                '', builder=builder, ignored_value=True,
            )
        msg = str(w[0].message)
        assert msg.startswith("Keyword arguments to the BeautifulSoup constructor will be ignored.")
        assert builder == soup.builder
        assert kwargs == builder.called_with

    def test_parser_markup_rejection(self):
        # If markup is completely rejected by the parser, an
       