File: fix-tests-for-2017a.patch

package info (click to toggle)
python-tz 2016.7-0.3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 420 kB
  • ctags: 601
  • sloc: python: 2,876; makefile: 8
file content (68 lines) | stat: -rw-r--r-- 2,280 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Date: 2017-03-30
From: Stuart Bishop <stuart.bishop@canonical.com>
Subject: Fix tests for 2017a tz abbreviation changes

Bug: https://bugs.launchpad.net/pytz/+bug/1677177
Bug-Debian: https://bugs.debian.org/858133
Origin: upstream, https://git.launchpad.net/pytz/commit/?id=c00dbe290bd1aa896b01db94f2e93449cf3bfd07

--- a/pytz/tests/test_tzinfo.py
+++ b/pytz/tests/test_tzinfo.py
@@ -501,7 +501,7 @@
         'dst': timedelta(0),
         }
     after = {
-        'tzname': 'NCT',
+        'tzname': '+11',  # pre-2017a, NCT
         'utcoffset': timedelta(hours=11),
         'dst': timedelta(0),
         }
@@ -512,12 +512,12 @@
     tzinfo = pytz.timezone('Pacific/Noumea')
     transition_time = datetime(1997, 3, 1, 15, 00, 00, tzinfo=UTC)
     before = {
-        'tzname': 'NCST',
+        'tzname': '+12',  # pre-2017a, NCST
         'utcoffset': timedelta(hours=12),
         'dst': timedelta(hours=1),
         }
     after = {
-        'tzname': 'NCT',
+        'tzname': '+11',  # pre-2017a, NCT
         'utcoffset': timedelta(hours=11),
         'dst': timedelta(0),
         }
@@ -541,7 +541,7 @@
         'dst': timedelta(0),
         }
     after = {
-        'tzname': 'TAHT',
+        'tzname': '-10',  # pre-2017a, TAHT
         'utcoffset': timedelta(hours=-10),
         'dst': timedelta(0),
         }
@@ -554,12 +554,12 @@
     tzinfo = pytz.timezone('Pacific/Apia')
     transition_time = datetime(2011, 12, 30, 10, 0, 0, tzinfo=UTC)
     before = {
-        'tzname': 'SDT',
+        'tzname': '-10',  # pre-2017a, SDT
         'utcoffset': timedelta(hours=-10),
         'dst': timedelta(hours=1),
         }
     after = {
-        'tzname': 'WSDT',
+        'tzname': '+14',  # pre-2017a, WSDT
         'utcoffset': timedelta(hours=14),
         'dst': timedelta(hours=1),
         }
@@ -611,7 +611,8 @@
         self.assertEqual(loc_time.strftime('%Z%z'), 'NST+0120')
 
         loc_time = loc_tz.localize(datetime(1940, 5, 10, 0, 0, 0))
-        self.assertEqual(loc_time.strftime('%Z%z'), 'NET+0020')
+        # pre-2017a, abbreviation was NCT
+        self.assertEqual(loc_time.strftime('%Z%z'), '+0020+0020')
 
         loc_time = loc_tz.localize(datetime(1940, 5, 20, 0, 0, 0))
         self.assertEqual(loc_time.strftime('%Z%z'), 'CEST+0200')