Refactor the tests for HtmlWriter.write_header()