class TestXMLDocument: def setup(self): self.doc = XMLDocument(root_tag='xml') self.doc.renderer = mock_renderer() def test_tag(self): test.assert_equal(repr(self.doc.html()), 'XmlNode(html)') test.assert_equal(repr(self.doc.text('hello')), 'TextNode(hello)') def test_render_tag(self): result = self.doc.render_tag('html') test.assert_equal(result, '<html></html>') def test_render(self): test.assert_equal(self.doc.render(), '<xml></xml>')
def setup(self): self.doc = XMLDocument(root_tag='xml') self.doc.renderer = mock_renderer()