~osomon/pyexiv2/pyexiv2-0.3

« back to all changes in this revision

Viewing changes to test/xmp.py

  • Committer: Olivier Tilloy
  • Date: 2011-10-24 07:41:16 UTC
  • mfrom: (369.1.2 regression-python26)
  • Revision ID: olivier@tilloy.net-20111024074116-g8ip3eu9ad11j715
Fix a couple of regressions that had bumped the dependency on Python ≥ 2.7.
pyexiv2 0.3 is now compatible with Python ≥ 2.6 again.

Show diffs side-by-side

added added

removed removed

Lines of Context:
184
184
        self.failUnlessRaises(XmpValueError, tag._convert_to_string, 'invalid', 'Date')
185
185
        self.failUnlessRaises(XmpValueError, tag._convert_to_string, None, 'Date')
186
186
 
187
 
    @unittest.skipIf(pytz is None, 'install python-tz to run this test')
188
187
    def test_convert_to_string_date_with_real_timezones(self):
 
188
        if pytz is None:
 
189
            # Poor man’s test skipping. Starting with Python 2.7, decorators are
 
190
            # available to implement this in a cleaner fashion
 
191
            # (http://docs.python.org/library/unittest.html#unittest-skipping).
 
192
            print 'Install python-tz to run this test. Skipping.'
 
193
            return
189
194
        tag = XmpTag('Xmp.xmp.CreateDate')
190
195
        self.assertEqual(tag.type, 'Date')
191
196
        t = pytz.timezone('UTC').localize(datetime.datetime(2011, 2, 2, 10, 52, 4))