add pytz-2016.10-fix-tests-with-2017a.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pytz?expand=0&rev=55
This commit is contained in:
Andreas Stieger 2017-03-15 21:41:50 +00:00 committed by Git OBS Bridge
parent f150777691
commit 82c4dd80ee
3 changed files with 80 additions and 2 deletions

View File

@ -1,9 +1,10 @@
-------------------------------------------------------------------
Thu Mar 2 16:39:42 UTC 2017 - astieger@suse.com
Wed Mar 15 21:33:50 UTC 2017 - astieger@suse.com
- update to 2016.10:
* includes IANA 2016j
* No longer fails with timezone-2017a bsc#1027705
add pytz-2016.10-fix-tests-with-2017a.patch
-------------------------------------------------------------------
Mon Apr 25 08:10:27 UTC 2016 - astieger@suse.com

View File

@ -30,12 +30,13 @@ Source90: pytz.keyring
Patch0: fix-tests.patch
# PATCH-FEATURE-OPENSUSE -- Use system tz database (Olson database)
Patch1: system_zoneinfo.patch
Patch2: pytz-2016.10-fix-tests-with-2017a.patch
Requires: timezone
BuildRequires: fdupes
BuildRequires: python-devel
BuildRequires: python-nose
# Tests will use this package
BuildRequires: timezone
BuildRequires: timezone >= 2017a
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
@ -63,6 +64,7 @@ Amost all of the Olson timezones are supported.
%if 0%{?suse_version} >= 1310
# Use system tz database
%patch1 -p1
%patch2 -p2
%endif
# For rpmlint warning: remove shebang from python library:
sed -i '/^#!/d' ./pytz/tzfile.py

View File

@ -0,0 +1,75 @@
From 838d7f06908c14352b0d4f3c5b656d0d95abaf9e Mon Sep 17 00:00:00 2001
From: Andreas Stieger <astieger@suse.com>
Date: Wed, 15 Mar 2017 22:23:14 +0100
Subject: [PATCH] test fixes for 2017a numeric zone name changes
References: boo#1027705 https://github.com/stub42/pytz/pull/1
https://github.com/stub42/pytz/pull/1/commits/838d7f06908c14352b0d4f3c5b656d0d95abaf9e
---
src/pytz/tests/test_tzinfo.py | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/pytz/tests/test_tzinfo.py b/src/pytz/tests/test_tzinfo.py
index 4d26d9ff..21812f6b 100644
--- a/src/pytz/tests/test_tzinfo.py
+++ b/src/pytz/tests/test_tzinfo.py
@@ -501,7 +501,7 @@ class NoumeaHistoryStartTestCase(USEasternDSTStartTestCase):
'dst': timedelta(0),
}
after = {
- 'tzname': 'NCT',
+ 'tzname': '+11',
'utcoffset': timedelta(hours=11),
'dst': timedelta(0),
}
@@ -512,12 +512,12 @@ class NoumeaDSTEndTestCase(USEasternDSTStartTestCase):
tzinfo = pytz.timezone('Pacific/Noumea')
transition_time = datetime(1997, 3, 1, 15, 00, 00, tzinfo=UTC)
before = {
- 'tzname': 'NCST',
+ 'tzname': '+12',
'utcoffset': timedelta(hours=12),
'dst': timedelta(hours=1),
}
after = {
- 'tzname': 'NCT',
+ 'tzname': '+11',
'utcoffset': timedelta(hours=11),
'dst': timedelta(0),
}
@@ -541,7 +541,7 @@ class TahitiTestCase(USEasternDSTStartTestCase):
'dst': timedelta(0),
}
after = {
- 'tzname': 'TAHT',
+ 'tzname': '-10',
'utcoffset': timedelta(hours=-10),
'dst': timedelta(0),
}
@@ -554,12 +554,12 @@ class SamoaInternationalDateLineChange(USEasternDSTStartTestCase):
tzinfo = pytz.timezone('Pacific/Apia')
transition_time = datetime(2011, 12, 30, 10, 0, 0, tzinfo=UTC)
before = {
- 'tzname': 'SDT',
+ 'tzname': '-10',
'utcoffset': timedelta(hours=-10),
'dst': timedelta(hours=1),
}
after = {
- 'tzname': 'WSDT',
+ 'tzname': '+14',
'utcoffset': timedelta(hours=14),
'dst': timedelta(hours=1),
}
@@ -611,7 +611,7 @@ class LocalTestCase(unittest.TestCase):
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')
+ 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')
--
2.12.0