def test_find_lost_section(self): with self.tree.builder("PART") as part: with part.REGTEXT() as regtext: regtext.AMDPAR(u"3. In § 105.1, revise paragraph (b) to read " "as follows:") with part.REGTEXT() as regtext: with regtext.SECTION() as section: section.SECTNO(" 205.4 ") section.SUBJECT("[Corrected]") amdpar = self.tree.render_xml().xpath('//AMDPAR')[0] section = diff.find_lost_section(amdpar) self.assertNotEqual(None, section)
def test_find_lost_section(self): amdpar_xml = u""" <PART> <REGTEXT> <AMDPAR> 3. In § 105.1, revise paragraph (b) to read as follows: </AMDPAR> </REGTEXT> <REGTEXT> <SECTION> <SECTNO> 205.4 </SECTNO> <SUBJECT>[Corrected]</SUBJECT> </SECTION> </REGTEXT></PART>""" amdpar = etree.fromstring(amdpar_xml).xpath("//AMDPAR")[0] section = diff.find_lost_section(amdpar) self.assertNotEqual(None, section)
def test_find_lost_section(self): amdpar_xml = u""" <PART> <REGTEXT> <AMDPAR> 3. In § 105.1, revise paragraph (b) to read as follows: </AMDPAR> </REGTEXT> <REGTEXT> <SECTION> <SECTNO> 205.4 </SECTNO> <SUBJECT>[Corrected]</SUBJECT> </SECTION> </REGTEXT></PART>""" amdpar = etree.fromstring(amdpar_xml).xpath('//AMDPAR')[0] section = diff.find_lost_section(amdpar) self.assertNotEqual(None, section)