Hello community,

here is the log from the commit of package python-wsgi_intercept for 
openSUSE:Factory checked in at 2020-02-07 15:53:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-wsgi_intercept (Old)
 and      /work/SRC/openSUSE:Factory/.python-wsgi_intercept.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-wsgi_intercept"

Fri Feb  7 15:53:44 2020 rev:24 rq:770570 version:1.9.2

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-wsgi_intercept/python-wsgi_intercept.changes  
    2019-11-12 16:11:15.399741864 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-wsgi_intercept.new.26092/python-wsgi_intercept.changes
   2020-02-07 15:54:35.759516826 +0100
@@ -1,0 +2,9 @@
+Thu Feb  6 12:42:53 UTC 2020 - Marketa Calabkova <[email protected]>
+
+- update to 1.9.2
+  * Don't send headers until we've read some results
+  * Update testing to include python 3.7 and 3.8
+  * Adding skipnetwork decorator to external resource
+  * Enable support for verify=False set in requests library.
+
+-------------------------------------------------------------------

Old:
----
  wsgi_intercept-1.9.0.tar.gz

New:
----
  wsgi_intercept-1.9.2.tar.gz

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

Other differences:
------------------
++++++ python-wsgi_intercept.spec ++++++
--- /var/tmp/diff_new_pack.ADbPEP/_old  2020-02-07 15:54:37.735517906 +0100
+++ /var/tmp/diff_new_pack.ADbPEP/_new  2020-02-07 15:54:37.735517906 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-wsgi_intercept
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-wsgi_intercept
-Version:        1.9.0
+Version:        1.9.2
 Release:        0
 Summary:        Library for installing a WSGI application in place of a real 
URI for testing
 License:        MIT

++++++ wsgi_intercept-1.9.0.tar.gz -> wsgi_intercept-1.9.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wsgi_intercept-1.9.0/PKG-INFO 
new/wsgi_intercept-1.9.2/PKG-INFO
--- old/wsgi_intercept-1.9.0/PKG-INFO   2019-10-15 13:44:12.000000000 +0200
+++ new/wsgi_intercept-1.9.2/PKG-INFO   2020-02-05 12:15:55.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: wsgi_intercept
-Version: 1.9.0
+Version: 1.9.2
 Summary: wsgi_intercept installs a WSGI application in place of a real URI for 
testing.
 Home-page: http://pypi.python.org/pypi/wsgi_intercept
 Author: Titus Brown, Kumar McMillan, Chris Dent, Sasha Hart
@@ -22,7 +22,7 @@
         ==================
         
         ``wsgi_intercept`` works with a variety of HTTP clients in Python 2.7,
-        3.4 and beyond, and in pypy.
+        3.5 and beyond, and in pypy.
         
         * urllib2
         * urllib.request
@@ -123,8 +123,8 @@
         The Python 2 version of wsgi-intercept was the result. Kumar McMillan
         later took over maintenance.
         
-        The current version is tested with Python 2.7, 3.4, 3.5, 3.6, and pypy
-        and was assembled by `Chris Dent`_. Testing and documentation 
improvements
+        The current version is tested with Python 2.7, 3.5-3.8, and pypy and 
pypy3.
+        It was assembled by `Chris Dent`_. Testing and documentation 
improvements
         from `Sasha Hart`_.
         
         .. _"best Web testing framework":
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wsgi_intercept-1.9.0/README 
new/wsgi_intercept-1.9.2/README
--- old/wsgi_intercept-1.9.0/README     2019-10-15 13:44:07.000000000 +0200
+++ new/wsgi_intercept-1.9.2/README     2020-02-05 12:15:50.000000000 +0100
@@ -14,7 +14,7 @@
 ==================
 
 ``wsgi_intercept`` works with a variety of HTTP clients in Python 2.7,
-3.4 and beyond, and in pypy.
+3.5 and beyond, and in pypy.
 
 * urllib2
 * urllib.request
@@ -115,8 +115,8 @@
 The Python 2 version of wsgi-intercept was the result. Kumar McMillan
 later took over maintenance.
 
-The current version is tested with Python 2.7, 3.4, 3.5, 3.6, and pypy
-and was assembled by `Chris Dent`_. Testing and documentation improvements
+The current version is tested with Python 2.7, 3.5-3.8, and pypy and pypy3.
+It was assembled by `Chris Dent`_. Testing and documentation improvements
 from `Sasha Hart`_.
 
 .. _"best Web testing framework":
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wsgi_intercept-1.9.0/setup.py 
new/wsgi_intercept-1.9.2/setup.py
--- old/wsgi_intercept-1.9.0/setup.py   2019-10-15 13:19:21.000000000 +0200
+++ new/wsgi_intercept-1.9.2/setup.py   2020-02-05 12:13:22.000000000 +0100
@@ -1,7 +1,7 @@
 
 from setuptools import setup, find_packages
 
-VERSION = '1.9.0'
+VERSION = '1.9.2'
 
 CLASSIFIERS = """
 Environment :: Web Environment
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wsgi_intercept-1.9.0/wsgi_intercept/__init__.py 
new/wsgi_intercept-1.9.2/wsgi_intercept/__init__.py
--- old/wsgi_intercept-1.9.0/wsgi_intercept/__init__.py 2018-07-06 
12:55:47.000000000 +0200
+++ new/wsgi_intercept-1.9.2/wsgi_intercept/__init__.py 2020-02-05 
12:08:46.000000000 +0100
@@ -14,7 +14,7 @@
 ==================
 
 ``wsgi_intercept`` works with a variety of HTTP clients in Python 2.7,
-3.4 and beyond, and in pypy.
+3.5 and beyond, and in pypy.
 
 * urllib2
 * urllib.request
@@ -115,8 +115,8 @@
 The Python 2 version of wsgi-intercept was the result. Kumar McMillan
 later took over maintenance.
 
-The current version is tested with Python 2.7, 3.4, 3.5, 3.6, and pypy
-and was assembled by `Chris Dent`_. Testing and documentation improvements
+The current version is tested with Python 2.7, 3.5-3.8, and pypy and pypy3.
+It was assembled by `Chris Dent`_. Testing and documentation improvements
 from `Sasha Hart`_.
 
 .. _"best Web testing framework":
@@ -451,25 +451,6 @@
             raise WSGIAppError(error, sys.exc_info())
         self.result = iter(app_result)
 
-        # send the headers
-
-        for k, v in self.headers:
-            if STRICT_RESPONSE_HEADERS:
-                if not (isinstance(k, str) and isinstance(v, str)):
-                    raise TypeError(
-                        "Header has a key '%s' or value '%s' "
-                        "which is not a native str." % (k, v))
-            try:
-                k = k.encode('ISO-8859-1')
-            except AttributeError:
-                pass
-            try:
-                v = v.encode('ISO-8859-1')
-            except AttributeError:
-                pass
-            self.output.write(k + b': ' + v + b"\n")
-        self.output.write(b'\n')
-
         ###
 
         # read all of the results.  the trick here is to get the *first*
@@ -485,6 +466,25 @@
                 generator_data = next(self.result)
 
             finally:
+                # send the headers
+
+                for k, v in self.headers:
+                    if STRICT_RESPONSE_HEADERS:
+                        if not (isinstance(k, str) and isinstance(v, str)):
+                            raise TypeError(
+                                "Header has a key '%s' or value '%s' "
+                                "which is not a native str." % (k, v))
+                    try:
+                        k = k.encode('ISO-8859-1')
+                    except AttributeError:
+                        pass
+                    try:
+                        v = v.encode('ISO-8859-1')
+                    except AttributeError:
+                        pass
+                    self.output.write(k + b': ' + v + b"\n")
+                self.output.write(b'\n')
+
                 for data in self.write_results:
                     self.output.write(data)
 
@@ -623,6 +623,24 @@
             else:
                 try:
                     import ssl
+                    if hasattr(self, '_context'):
+                        self._context.check_hostname = self.assert_hostname
+                        self._check_hostname = self.assert_hostname     # Py3.6
+                        if hasattr(ssl, 'VerifyMode'):
+                            # Support for Python3.6 and higher
+                            if isinstance(self.cert_reqs, ssl.VerifyMode):
+                                self._context.verify_mode = self.cert_reqs
+                            else:
+                                self._context.verify_mode = ssl.VerifyMode[
+                                    self.cert_reqs]
+                        elif isinstance(self.cert_reqs, six.string_types):
+                            # Support for Python3.5 and below
+                            self._context.verify_mode = getattr(ssl,
+                                    self.cert_reqs,
+                                    self._context.verify_mode)
+                        else:
+                            self._context.verify_mode = self.cert_reqs
+
                     if not hasattr(self, 'key_file'):
                         self.key_file = None
                     if not hasattr(self, 'cert_file'):
@@ -640,7 +658,8 @@
                             else:
                                 self._check_hostname = self.check_hostname
                 except (ImportError, AttributeError):
-                    pass
+                    import traceback
+                    traceback.print_exc()
                 HTTPSConnection.connect(self)
 
         except Exception:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/wsgi_intercept-1.9.0/wsgi_intercept/tests/test_requests.py 
new/wsgi_intercept-1.9.2/wsgi_intercept/tests/test_requests.py
--- old/wsgi_intercept-1.9.0/wsgi_intercept/tests/test_requests.py      
2019-10-15 13:17:48.000000000 +0200
+++ new/wsgi_intercept-1.9.2/wsgi_intercept/tests/test_requests.py      
2020-02-05 12:08:46.000000000 +0100
@@ -59,6 +59,22 @@
         assert app.success()
 
 
+def test_https_no_ssl_verification_intercepted():
+    with InstalledApp(wsgi_app.simple_app, host=HOST, port=443) as app:
+        resp = requests.get('https://some_hopefully_nonexistant_domain:443/',
+                            verify=False)
+        assert resp.content == b'WSGI intercept successful!\n'
+        assert app.success()
+
+
+@skipnetwork
+def test_https_no_ssl_verification_not_intercepted():
+    with InstalledApp(wsgi_app.simple_app, host=HOST, port=443) as app:
+        resp = requests.get('https://self-signed.badssl.com/', verify=False)
+        assert resp.status_code >= 200 and resp.status_code < 300
+        assert not app.success()
+
+
 def test_https_default_port():
     with InstalledApp(wsgi_app.simple_app, host=HOST, port=443) as app:
         resp = requests.get('https://some_hopefully_nonexistant_domain/')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/wsgi_intercept-1.9.0/wsgi_intercept/tests/test_wsgi_compliance.py 
new/wsgi_intercept-1.9.2/wsgi_intercept/tests/test_wsgi_compliance.py
--- old/wsgi_intercept-1.9.0/wsgi_intercept/tests/test_wsgi_compliance.py       
2018-01-11 12:48:47.000000000 +0100
+++ new/wsgi_intercept-1.9.2/wsgi_intercept/tests/test_wsgi_compliance.py       
2020-02-05 12:08:46.000000000 +0100
@@ -114,3 +114,13 @@
             'http://some_hopefully_nonexistant_domain/', 'GET')
         assert app.success()
         assert content == b'second'
+
+
+def test_generator():
+    with InstalledApp(wsgi_app.generator_app, host=HOST) as app:
+        http = httplib2.Http()
+        resp, content = http.request(
+            'http://some_hopefully_nonexistant_domain/', 'GET')
+        assert app.success()
+        assert resp.get('content-type') == 'text/plain'
+        assert content == b'First generated line\nSecond generated line\n'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/wsgi_intercept-1.9.0/wsgi_intercept/tests/wsgi_app.py 
new/wsgi_intercept-1.9.2/wsgi_intercept/tests/wsgi_app.py
--- old/wsgi_intercept-1.9.0/wsgi_intercept/tests/wsgi_app.py   2018-01-11 
12:48:47.000000000 +0100
+++ new/wsgi_intercept-1.9.2/wsgi_intercept/tests/wsgi_app.py   2020-02-05 
12:08:46.000000000 +0100
@@ -37,3 +37,9 @@
 def empty_string_app(environ, start_response):
     start_response('200 OK', [('Content-type', 'text/plain')])
     return [b'', b'second']
+
+
+def generator_app(environ, start_response):
+    start_response('200 OK', [('Content-type', 'text/plain')])
+    yield b'First generated line\n'
+    yield b'Second generated line\n'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/wsgi_intercept-1.9.0/wsgi_intercept.egg-info/PKG-INFO 
new/wsgi_intercept-1.9.2/wsgi_intercept.egg-info/PKG-INFO
--- old/wsgi_intercept-1.9.0/wsgi_intercept.egg-info/PKG-INFO   2019-10-15 
13:44:12.000000000 +0200
+++ new/wsgi_intercept-1.9.2/wsgi_intercept.egg-info/PKG-INFO   2020-02-05 
12:15:55.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: wsgi-intercept
-Version: 1.9.0
+Version: 1.9.2
 Summary: wsgi_intercept installs a WSGI application in place of a real URI for 
testing.
 Home-page: http://pypi.python.org/pypi/wsgi_intercept
 Author: Titus Brown, Kumar McMillan, Chris Dent, Sasha Hart
@@ -22,7 +22,7 @@
         ==================
         
         ``wsgi_intercept`` works with a variety of HTTP clients in Python 2.7,
-        3.4 and beyond, and in pypy.
+        3.5 and beyond, and in pypy.
         
         * urllib2
         * urllib.request
@@ -123,8 +123,8 @@
         The Python 2 version of wsgi-intercept was the result. Kumar McMillan
         later took over maintenance.
         
-        The current version is tested with Python 2.7, 3.4, 3.5, 3.6, and pypy
-        and was assembled by `Chris Dent`_. Testing and documentation 
improvements
+        The current version is tested with Python 2.7, 3.5-3.8, and pypy and 
pypy3.
+        It was assembled by `Chris Dent`_. Testing and documentation 
improvements
         from `Sasha Hart`_.
         
         .. _"best Web testing framework":


Reply via email to