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