Ejemplo n.º 1
0
    def testUTF8Japanese(self):
        fh = StringIO("""OFXHEADER:100
DATA:OFXSGML
VERSION:102
SECURITY:NONE
ENCODING:UTF-8
CHARSET:CSUNICODE
COMPRESSION:NONE
OLDFILEUID:NONE
NEWFILEUID:NONE
""")
        ofx_file = OfxFile(fh)
        headers = ofx_file.headers
        result = ofx_file.fh.read()

        self.assertTrue(type(result) is unicode)
        for key, value in headers.iteritems():
            self.assertTrue(type(key) is unicode)
            self.assertTrue(type(value) is not str)
Ejemplo n.º 2
0
    def testUTF8Japanese(self):
        fh = six.BytesIO(six.b("""OFXHEADER:100
DATA:OFXSGML
VERSION:102
SECURITY:NONE
ENCODING:UTF-8
CHARSET:CSUNICODE
COMPRESSION:NONE
OLDFILEUID:NONE
NEWFILEUID:NONE
"""))
        ofx_file = OfxFile(fh)
        headers = ofx_file.headers
        result = ofx_file.fh.read()

        self.assertTrue(type(result) is six.text_type)
        for key, value in six.iteritems(headers):
            self.assertTrue(type(key) is six.text_type)
            self.assertTrue(type(value) is not six.binary_type)
Ejemplo n.º 3
0
 def testBrokenLineEndings(self):
     fh = six.BytesIO(six.b("OFXHEADER:100\rDATA:OFXSGML\r"))
     ofx_file = OfxFile(fh)
     self.assertEquals(len(ofx_file.headers.keys()), 2)