def test_strip_empty_tags(self): empty_tags_file = open( join(realpath(dirname(__file__)), 'fixtures', 'empty_tags.ofx'), 'rU').read() empty_tag_pattern = '<(?P<tag>[^>]+)>\s*</(?P=tag)>' result = util.strip_empty_tags(empty_tags_file) self.assertFalse(re.match(empty_tag_pattern, result))
def parse(self, ofx): """Parse a string argument and return a tree structure representing the parsed document.""" ofx = strip_empty_tags(ofx) ofx = self.strip_close_tags(ofx) ofx = self.strip_blank_dtasof(ofx) ofx = self.strip_junk_ascii(ofx) ofx = self.fix_unknown_account_type(ofx) return self.parser.parseString(ofx).asDict()
def test_strip_empty_tags(self): empty_tags_file = open(join(realpath(dirname(__file__)), 'fixtures', 'empty_tags.ofx'), 'rU').read() empty_tag_pattern = '<(?P<tag>[^>]+)>\s*</(?P=tag)>' result = util.strip_empty_tags(empty_tags_file) self.assertFalse(re.match(empty_tag_pattern, result))