def test_get_subpart_title(self): xml = u""" <SUBPART> <HD>Subpart A—First subpart</HD> </SUBPART>""" subpart_title = reg_text.get_subpart_title(etree.fromstring(xml)) self.assertEqual(subpart_title, u'Subpart A—First subpart')
def test_get_subpart_title_reserved(self): with XMLBuilder("SUBPART") as ctx: ctx.RESERVED("Subpart J [Reserved]") subpart_title = reg_text.get_subpart_title(ctx.xml) self.assertEqual(subpart_title, u'Subpart J [Reserved]')
def test_get_subpart_title(self): with XMLBuilder("SUBPART") as ctx: ctx.HD(u"Subpart A—First subpart") subpart_title = reg_text.get_subpart_title(ctx.xml) self.assertEqual(subpart_title, u'Subpart A—First subpart')
def test_get_subpart_title_reserved(self): with self.tree.builder("SUBPART") as root: root.RESERVED("Subpart J [Reserved]") subpart_title = reg_text.get_subpart_title(self.tree.render_xml()) self.assertEqual(subpart_title, u'Subpart J [Reserved]')
def test_get_subpart_title(self): with self.tree.builder("SUBPART") as root: root.HD(u"Subpart A—First subpart") subpart_title = reg_text.get_subpart_title(self.tree.render_xml()) self.assertEqual(subpart_title, u'Subpart A—First subpart')