예제 #1
0
파일: test_util.py 프로젝트: m8nky/fixofx
    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))
예제 #2
0
파일: parser.py 프로젝트: Zavteq/fixofx
 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()
예제 #3
0
 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()
예제 #4
0
파일: test_util.py 프로젝트: Zavteq/fixofx
    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))