~ubuntu-branches/ubuntu/natty/python-tz/natty-proposed

« back to all changes in this revision

Viewing changes to pytz/tests/test_tzinfo.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-03-05 02:35:34 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070305023534-z5ms36hfatosmh2k
Tags: 2007c-0ubuntu1
* New upstream version.
* Set Ubuntu maintainer address.
* Replace the timezone data with a reference to the data in the
  tzdata package.
* One more package not duplicating timezone data. Ubuntu #86599.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
import pytz
14
14
from pytz import reference
15
15
 
16
 
EXPECTED_VERSION='2006p'
 
16
EXPECTED_VERSION='2007c'
17
17
 
18
18
fmt = '%Y-%m-%d %H:%M:%S %Z%z'
19
19
 
101
101
        self.failUnlessEqual(unpickled_tz._utcoffset.seconds, new_utcoffset)
102
102
        self.failUnless(tz is not unpickled_tz)
103
103
 
 
104
    def testOldPickles(self):
 
105
        # Ensure that applications serializing pytz instances as pickles
 
106
        # have no troubles upgrading to a new pytz release. These pickles
 
107
        # where created with pytz2006j
 
108
        east1 = pickle.loads(
 
109
                "cpytz\n_p\np1\n(S'US/Eastern'\np2\nI-18000\n"
 
110
                "I0\nS'EST'\np3\ntRp4\n."
 
111
                )
 
112
        east2 = pytz.timezone('US/Eastern')
 
113
        self.failUnless(east1 is east2)
 
114
 
 
115
        # Confirm changes in name munging between 2006j and 2007c cause
 
116
        # no problems.
 
117
        pap1 = pickle.loads(
 
118
                "cpytz\n_p\np1\n(S'America/Port_minus_au_minus_Prince'"
 
119
                "\np2\nI-17340\nI0\nS'PPMT'\np3\ntRp4\n."
 
120
                )
 
121
        pap2 = pytz.timezone('America/Port-au-Prince')
 
122
        self.failUnless(pap1 is pap2)
 
123
 
 
124
        gmt1 = pickle.loads("cpytz\n_p\np1\n(S'Etc/GMT_plus_10'\np2\ntRp3\n.")
 
125
        gmt2 = pytz.timezone('Etc/GMT+10')
 
126
        self.failUnless(gmt1 is gmt2)
 
127
 
104
128
 
105
129
class USEasternDSTStartTestCase(unittest.TestCase):
106
130
    tzinfo = pytz.timezone('US/Eastern')