MCPcopy Create free account
hub / github.com/ScrapeGraphAI/Scrapegraph-ai / test_reduce_html_reduction_1

Function test_reduce_html_reduction_1

tests/test_cleanup_html.py:101–117  ·  view source on GitHub ↗

Test reduce_html at reduction level 1 (remove unnecessary attributes and empty style tags).

()

Source from the content-addressed store, hash-verified

99
100
101def test_reduce_html_reduction_1():
102 """Test reduce_html at reduction level 1 (remove unnecessary attributes and empty style tags)."""
103 raw_html = """
104 <html>
105 <body>
106 <div style="color:red" data-extra="should_remove" class="keep">
107 <!-- comment should be removed -->
108 <p> Some text </p>
109 </div>
110 </body>
111 </html>
112 """
113 reduced = reduce_html(raw_html, 1)
114 # Ensure that unwanted attributes are removed (data-extra and style are gone, class remains)
115 assert "data-extra" not in reduced
116 assert "style=" not in reduced
117 assert 'class="keep"' in reduced
118
119
120def test_reduce_html_reduction_2():

Callers

nothing calls this directly

Calls 1

reduce_htmlFunction · 0.90

Tested by

no test coverage detected