Test minify_html function to remove comments and unnecessary whitespace.
()
| 68 | |
| 69 | |
| 70 | def test_minify_html(): |
| 71 | """Test minify_html function to remove comments and unnecessary whitespace.""" |
| 72 | raw_html = """ |
| 73 | <html> |
| 74 | <!-- this is a comment --> |
| 75 | <body> |
| 76 | <p> Hello World! </p> |
| 77 | </body> |
| 78 | </html> |
| 79 | """ |
| 80 | minified = minify_html(raw_html) |
| 81 | # There should be no comment and no unnecessary spaces between tags |
| 82 | assert "<!--" not in minified |
| 83 | assert " " not in minified |
| 84 | |
| 85 | |
| 86 | def test_reduce_html_reduction_0(): |
nothing calls this directly
no test coverage detected