~osomon/pyexiv2/pyexiv2-0.3

« back to all changes in this revision

Viewing changes to test/encoding.py

  • Committer: Olivier Tilloy
  • Date: 2011-08-01 19:15:41 UTC
  • mfrom: (357.1.1 unicode-filenames)
  • Revision ID: olivier@tilloy.net-20110801191541-o2pclkndoi17zu6d
Do not try (and fail!) to encode non-unicode filenames.

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
        m.read()
92
92
        os.remove(filename)
93
93
 
94
 
    def test_ascii_str(self):
 
94
    def test_ascii(self):
95
95
        self._test_filename('test.jpg')
96
96
 
97
 
    def test_ascii_unicode(self):
 
97
    def test_latin1(self):
 
98
        self._test_filename('tést.jpg')
 
99
 
 
100
    def test_latin1_escaped(self):
 
101
        self._test_filename('t\xc3\xa9st.jpg')
 
102
 
 
103
    def test_unicode_ascii(self):
98
104
        if self.encoding is not None:
99
105
            self._test_filename(u'test.jpg')
100
106
 
101
 
    def test_nonascii_unicode(self):
 
107
    def test_unicode_latin1(self):
102
108
        if self.encoding is not None:
103
109
            self._test_filename(u'tést.jpg')
104
110
 
105
 
    def test_nonascii_unicode_escaped(self):
 
111
    def test_unicode_latin1_escaped(self):
106
112
        if self.encoding is not None:
107
113
            self._test_filename(u't\xe9st.jpg')
108
114