Hello community,

here is the log from the commit of package python-fs for openSUSE:Factory 
checked in at 2017-11-30 12:45:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-fs (Old)
 and      /work/SRC/openSUSE:Factory/.python-fs.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-fs"

Thu Nov 30 12:45:24 2017 rev:3 rq:546324 version:2.0.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-fs/python-fs.changes      2017-08-24 
18:54:07.606822893 +0200
+++ /work/SRC/openSUSE:Factory/.python-fs.new/python-fs.changes 2017-11-30 
12:45:25.813834049 +0100
@@ -1,0 +2,5 @@
+Tue Nov 28 19:41:26 UTC 2017 - [email protected]
+
+- Add python-fs-fix-ftp-test.patch to make ftp tests pass in 2018
+
+-------------------------------------------------------------------

New:
----
  python-fs-fix-ftp-test.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-fs.spec ++++++
--- /var/tmp/diff_new_pack.KnCUeV/_old  2017-11-30 12:45:26.481809766 +0100
+++ /var/tmp/diff_new_pack.KnCUeV/_new  2017-11-30 12:45:26.485809620 +0100
@@ -29,6 +29,8 @@
 Source:         
https://files.pythonhosted.org/packages/source/f/fs/fs-%{version}.tar.gz
 # PATCH-FIX-UPSTREAM more-relaxed-requirements.patch [email protected] 
-- Weaken the version dependencies
 Patch0:         more-relaxed-requirements.patch
+# PATCH-FIX-OPENSUSE make ftp tests pass in 2018
+Patch1:         python-fs-fix-ftp-test.patch
 BuildRequires:  %{python_module devel}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  python-rpm-macros
@@ -63,6 +65,7 @@
 %prep
 %setup -q -n fs-%{version}
 %patch0
+%patch1 -p1
 
 %build
 %python_build

++++++ python-fs-fix-ftp-test.patch ++++++
Date: 2017-11-28
Author: Bernhard M. Wiedemann <bwiedemann suse de>

Make ftp tests pass in 2018

The previous code assumed that time.localtime would return tm_year=2017

Someone could probably upstream a fix using unittest.mock
for time.localtime with 
return_value = time.struct_time(tm_year=2017, tm_mon=11, tm_mday=28, 
tm_hour=19, tm_min=21, tm_sec=19, tm_wday=1, tm_yday=332, tm_isdst=0)

Index: fs-2.0.4/tests/test_ftp_parse.py
===================================================================
--- fs-2.0.4.orig/tests/test_ftp_parse.py
+++ fs-2.0.4/tests/test_ftp_parse.py
@@ -15,12 +15,6 @@ class TestFTPParse(unittest.TestCase):
             142214400.0
         )
 
-        year = time.localtime().tm_year
-        self.assertEqual(
-            ftp_parse._parse_time('JUL 05 02:00'),
-            1499220000.0
-        )
-
         self.assertEqual(
             ftp_parse._parse_time("notadate"),
             None
@@ -35,9 +29,9 @@ class TestFTPParse(unittest.TestCase):
     def test_decode_linux(self):
         directory = """\
 lrwxrwxrwx    1 0        0              19 Jan 18  2006 debian -> 
./pub/mirror/debian
-drwxr-xr-x   10 0        0            4096 Aug 03 09:21 debian-archive
+drwxr-xr-x   10 0        0            4096 Jan 18  2006 debian-archive
 lrwxrwxrwx    1 0        0              27 Nov 30  2015 debian-backports -> 
pub/mirror/debian-backports
-drwxr-xr-x   12 0        0            4096 Sep 29 13:13 pub
+drwxr-xr-x   12 0        0            4096 Jan 18  2006 pub
 -rw-r--r--    1 0        0              26 Mar 04  2010 robots.txt
 """
 
@@ -65,8 +59,8 @@ drwxr-xr-x   12 0        0            40
                                u'u_x'],
               u'user': u'0'},
   u'basic': {u'is_dir': True, u'name': u'debian-archive'},
-  u'details': {u'modified': 1501752060.0, u'size': 4096, u'type': 1},
-  u'ftp': {u'ls': u'drwxr-xr-x   10 0        0            4096 Aug 03 09:21 
debian-archive'}},
+  u'details': {u'modified': 1137542400.0, u'size': 4096, u'type': 1},
+  u'ftp': {u'ls': u'drwxr-xr-x   10 0        0            4096 Jan 18  2006 
debian-archive'}},
  {u'access': {u'group': u'0',
               u'permissions': [u'g_r',
                                u'g_w',
@@ -91,8 +85,8 @@ drwxr-xr-x   12 0        0            40
                                u'u_x'],
               u'user': u'0'},
   u'basic': {u'is_dir': True, u'name': u'pub'},
-  u'details': {u'modified': 1506690780.0, u'size': 4096, u'type': 1},
-  u'ftp': {u'ls': u'drwxr-xr-x   12 0        0            4096 Sep 29 13:13 
pub'}},
+  u'details': {u'modified': 1137542400.0, u'size': 4096, u'type': 1},
+  u'ftp': {u'ls': u'drwxr-xr-x   12 0        0            4096 Jan 18  2006 
pub'}},
  {u'access': {u'group': u'0',
               u'permissions': [u'g_r', u'o_r', u'u_r', u'u_w'],
               u'user': u'0'},

Reply via email to