Beispiel #1
0
    def test_combine_parts(self):
        docs = [
            HTMLFeatureInfoDoc('<p>foo</p>'),
            HTMLFeatureInfoDoc('<body><p>bar</p></body>'),
            HTMLFeatureInfoDoc('<html><head><title>Hello<body><p>baz</p><p>baz2'),
        ]
        result = HTMLFeatureInfoDoc.combine(docs)

        assert (b'<body><p>foo</p><p>bar</p><p>baz</p><p>baz2</p></body>' in
            result.as_string())
        eq_(result.info_type, 'html')
Beispiel #2
0
    def test_combine_parts(self):
        docs = [
            HTMLFeatureInfoDoc('<p>foo</p>'),
            HTMLFeatureInfoDoc('<body><p>bar</p></body>'),
            HTMLFeatureInfoDoc('<html><head><title>Hello<body><p>baz</p><p>baz2'),
        ]
        result = HTMLFeatureInfoDoc.combine(docs)

        assert (b'<body><p>foo</p><p>bar</p><p>baz</p><p>baz2</p></body>' in
            result.as_string())
        eq_(result.info_type, 'html')
Beispiel #3
0
    def test_combine(self):
        docs = [
            HTMLFeatureInfoDoc(b'<html><head><title>Hello<body><p>baz</p><p>baz2'),
            HTMLFeatureInfoDoc(b'<p>foo</p>'),
            HTMLFeatureInfoDoc(b'<body><p>bar</p></body>'),
        ]
        result = HTMLFeatureInfoDoc.combine(docs)

        eq_(b"<html><head><title>Hello<body><p>baz</p>"
            b"<p>baz2\n<p>foo</p>\n<body><p>bar</p></body>",
            result.as_string())
        eq_(result.info_type, 'text')
Beispiel #4
0
    def test_combine(self):
        docs = [
            HTMLFeatureInfoDoc(b'<html><head><title>Hello<body><p>baz</p><p>baz2'),
            HTMLFeatureInfoDoc(b'<p>foo</p>'),
            HTMLFeatureInfoDoc(b'<body><p>bar</p></body>'),
        ]
        result = HTMLFeatureInfoDoc.combine(docs)

        eq_(b"<html><head><title>Hello<body><p>baz</p>"
            b"<p>baz2\n<p>foo</p>\n<body><p>bar</p></body>",
            result.as_string())
        eq_(result.info_type, 'text')
Beispiel #5
0
    def test_combine_parts(self):
        docs = [
            HTMLFeatureInfoDoc("<p>foo</p>"),
            HTMLFeatureInfoDoc("<body><p>bar</p></body>"),
            HTMLFeatureInfoDoc(
                "<html><head><title>Hello<body><p>baz</p><p>baz2"),
        ]
        result = HTMLFeatureInfoDoc.combine(docs)

        assert (b"<body><p>foo</p><p>bar</p><p>baz</p><p>baz2</p></body>"
                in result.as_string())
        assert result.info_type == "html"