Ejemplo n.º 1
0
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" />'
Ejemplo n.º 2
0
def test_xml_single_with_no_attributes():
    line_break = XmlSingle('br')
    assert render(
        line_break
    ) == '<br />'
Ejemplo n.º 3
0
def test_xml_single_with_one_attribute():
    logo = XmlSingle('img', src='/images/logo.png')
    assert render(
        logo
    ) == '<img src="/images/logo.png" />'
Ejemplo n.º 4
0
 def render(self, out: OutputIO):
     render(out, self._comment)
Ejemplo n.º 5
0
 def render(self, out: OutputIO):
     render(out, self._element_tag)
Ejemplo n.º 6
0
def test_xml_comment():
    assert render(
        XmlComment('Lorem ipsum.')
    ) == '<!-- Lorem ipsum. -->'
Ejemplo n.º 7
0
 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)