def test_xml_single_with_two_attributes(): splash_image = XmlSingle('img', src='/images/splash.png', title='home page splash') assert render( splash_image ) == '<img src="/images/splash.png" title="home page splash" />'
def test_xml_single_with_no_attributes(): line_break = XmlSingle('br') assert render( line_break ) == '<br />'
def test_xml_single_with_one_attribute(): logo = XmlSingle('img', src='/images/logo.png') assert render( logo ) == '<img src="/images/logo.png" />'
def render(self, out: OutputIO): render(out, self._comment)
def render(self, out: OutputIO): render(out, self._element_tag)
def test_xml_comment(): assert render( XmlComment('Lorem ipsum.') ) == '<!-- Lorem ipsum. -->'
def build(self, root_path: UrlPath): target_path = root_path.concatenate( self.build_path)[self.file_name].path with open_file_out(target_path) as f: render(f, self.output)