~ubuntu-branches/ubuntu/quantal/python-tz/quantal

« back to all changes in this revision

Viewing changes to pytz/tests/test_tzinfo.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2008-10-27 07:29:54 UTC
  • mfrom: (1.1.9 upstream) (2.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20081027072954-y0tje6borovf4eva
Tags: 2008h-1
* New upstream version.
  - Fixes lookup errors with unknown timezones (error setting US/Pacific-New
    timezone. LP: #244681).
* debian/copyright: Update copyright year and download location.
* debian/control: Update homepage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
# I test for expected version to ensure the correct version of pytz is
17
17
# actually being tested.
18
 
EXPECTED_VERSION='2008b'
 
18
EXPECTED_VERSION='2008h'
19
19
 
20
20
fmt = '%Y-%m-%d %H:%M:%S %Z%z'
21
21
 
407
407
        self.failUnlessEqual(loc_time.strftime('%Z%z'), 'EST-0500')
408
408
 
409
409
        self.failUnlessRaises(pytz.AmbiguousTimeError,
410
 
                loc_tz.localize, datetime(1918, 10, 27, 1, 59, 59), is_dst=None
411
 
                )
 
410
            loc_tz.localize, datetime(1918, 10, 27, 1, 59, 59), is_dst=None
 
411
            )
 
412
 
 
413
        # Start of DST non-existent times
 
414
        loc_time = loc_tz.localize(datetime(1918, 3, 31, 2, 0, 0), is_dst=0)
 
415
        self.failUnlessEqual(loc_time.strftime('%Z%z'), 'EST-0500')
 
416
 
 
417
        loc_time = loc_tz.localize(datetime(1918, 3, 31, 2, 0, 0), is_dst=1)
 
418
        self.failUnlessEqual(loc_time.strftime('%Z%z'), 'EDT-0400')
 
419
 
 
420
        self.failUnlessRaises(pytz.NonExistentTimeError,
 
421
            loc_tz.localize, datetime(1918, 3, 31, 2, 0, 0), is_dst=None
 
422
            )
412
423
 
413
424
        # Weird changes - war time and peace time both is_dst==True
414
425