made bs4 and soupsieve standalone in this project
This commit is contained in:
@ -7,17 +7,17 @@ import unittest
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
from ...bs4 import (
|
||||
from .. import (
|
||||
BeautifulSoup,
|
||||
BeautifulStoneSoup,
|
||||
GuessedAtParserWarning,
|
||||
MarkupResemblesLocatorWarning,
|
||||
)
|
||||
from ...bs4.builder import (
|
||||
from ..builder import (
|
||||
TreeBuilder,
|
||||
ParserRejectedMarkup,
|
||||
)
|
||||
from ...bs4.element import (
|
||||
from ..element import (
|
||||
CharsetMetaAttributeValue,
|
||||
Comment,
|
||||
ContentMetaAttributeValue,
|
||||
@ -27,13 +27,13 @@ from ...bs4.element import (
|
||||
NavigableString,
|
||||
)
|
||||
|
||||
from ...bs4.dammit import *
|
||||
from ...bs4.dammit import (
|
||||
from ..dammit import *
|
||||
from ..dammit import (
|
||||
EntitySubstitution,
|
||||
UnicodeDammit,
|
||||
EncodingDetector,
|
||||
)
|
||||
from ...bs4.testing import (
|
||||
from ..testing import (
|
||||
default_builder,
|
||||
SoupTest,
|
||||
skipIf,
|
||||
@ -41,7 +41,7 @@ from ...bs4.testing import (
|
||||
import warnings
|
||||
|
||||
try:
|
||||
from ...bs4.builder import LXMLTreeBuilder, LXMLTreeBuilderForXML
|
||||
from ..builder import LXMLTreeBuilder, LXMLTreeBuilderForXML
|
||||
LXML_PRESENT = True
|
||||
except ImportError as e:
|
||||
LXML_PRESENT = False
|
||||
@ -120,11 +120,10 @@ class TestConstructor(SoupTest):
|
||||
def feed(self, *args, **kwargs):
|
||||
raise ParserRejectedMarkup("Nope.")
|
||||
|
||||
def prepare_markup(self, *args, **kwargs):
|
||||
# We're going to try two different ways of preparing this markup,
|
||||
# but feed() will reject both of them.
|
||||
yield markup, None, None, False
|
||||
yield markup, None, None, False
|
||||
def prepare_markup(self, markup, *args, **kwargs):
|
||||
# We're going to try two different ways of preparing this markup,
|
||||
# but feed() will reject both of them.
|
||||
yield markup, None, None, False
|
||||
|
||||
import re
|
||||
self.assertRaisesRegex(
|
||||
@ -613,7 +612,7 @@ class TestUnicodeDammit(unittest.TestCase):
|
||||
self.assertRaises(UnicodeDecodeError, doc.decode, "utf8")
|
||||
|
||||
# Unicode, Dammit thinks the whole document is Windows-1252,
|
||||
# and decodes it into "☃☃☃“Hi, I like Windows!”☃☃☃"
|
||||
# and decodes it into "☃☃☃"Hi, I like Windows!"☃☃☃"
|
||||
|
||||
# But if we run it through fix_embedded_windows_1252, it's fixed:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user