File: zoneinfo-tests-to-tz.patch

package info (click to toggle)
python3-dateutil 2.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 980 kB
  • sloc: python: 6,430; makefile: 56
file content (31 lines) | stat: -rw-r--r-- 1,267 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
Date: Mon Apr  2 19:48:46 BST 2012
Author: Thomas Kluyver <thomas@kluyver.me.uk>
Subject: Fix Zoneinfo tests

The zoneinfo module depends on binary data which is removed from the source
package. tz.gettz() should behave in the same way.
--- a/test.py
+++ b/test.py
@@ -3887,18 +3887,18 @@
         self.assertEqual(datetime(2003, 10, 26, 1, 00, tzinfo=tz).tzname(), "EST")
 
     def testZoneInfoFileStart1(self):
-        tz = zoneinfo.gettz("EST5EDT")
+        tz = gettz("EST5EDT")
         self.assertEqual(datetime(2003, 4, 6, 1, 59, tzinfo=tz).tzname(), "EST")
         self.assertEqual(datetime(2003, 4, 6, 2, 00, tzinfo=tz).tzname(), "EDT")
 
     def testZoneInfoFileEnd1(self):
-        tz = zoneinfo.gettz("EST5EDT")
+        tz = gettz("EST5EDT")
         self.assertEqual(datetime(2003, 10, 26, 0, 59, tzinfo=tz).tzname(), "EDT")
         self.assertEqual(datetime(2003, 10, 26, 1, 00, tzinfo=tz).tzname(), "EST")
 
     def testZoneInfoOffsetSignal(self):
-        utc = zoneinfo.gettz("UTC")
-        nyc = zoneinfo.gettz("America/New_York")
+        utc = gettz("UTC")
+        nyc = gettz("America/New_York")
         self.assertFalse(any([None in [utc, nyc]]))
         t0 = datetime(2007, 11, 4, 0, 30, tzinfo=nyc)
         t1 = t0.astimezone(utc)