From da375d52de6d06d5f324df465accde36c8175ae4 Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Mar 27 2020 10:45:44 +0000 Subject: 1.0.2 --- diff --git a/.gitignore b/.gitignore index ba2596e..c9fed39 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /httpretty-0.9.5.tar.gz /httpretty-0.9.6.tar.gz /httpretty-0.9.7.tar.gz +/httpretty-1.0.2.tar.gz diff --git a/python-httpretty-fakesock_getpeercert_noconnect.patch b/python-httpretty-fakesock_getpeercert_noconnect.patch index 6956641..6fd10d3 100644 --- a/python-httpretty-fakesock_getpeercert_noconnect.patch +++ b/python-httpretty-fakesock_getpeercert_noconnect.patch @@ -1,23 +1,24 @@ ---- HTTPretty/tests/unit/test_core.py 2017-01-06 15:04:06.030520764 -0800 -+++ HTTPretty/tests/unit/test_core.py.new 2017-01-06 15:37:17.932752818 -0800 -@@ -192,31 +192,37 @@ - @patch('httpretty.core.datetime') - def test_fakesock_socket_getpeercert(dt): +diff -up httpretty-1.0.2/tests/unit/test_core.py.orig httpretty-1.0.2/tests/unit/test_core.py +--- httpretty-1.0.2/tests/unit/test_core.py.orig 2020-03-20 01:54:16.000000000 +0100 ++++ httpretty-1.0.2/tests/unit/test_core.py 2020-03-27 11:14:13.000000000 +0100 +@@ -190,28 +190,35 @@ def test_fake_ssl_socket_proxies_its_ow_ + @freeze_time("2013-10-04 04:20:00") + def test_fakesock_socket_getpeercert(): ("fakesock.socket#getpeercert should return a hardcoded fake certificate") -- # Background: -- dt.now.return_value = datetime(2013, 10, 4, 4, 20, 0) -+ # Don't bother with an actual remote roundtrip -+ httpretty.allow_net_connect = False - - # Given a fake socket instance - socket = fakesock.socket() -- + - # And that it's bound to some host - socket._host = 'somewhere.com' -- ++ # Don't bother with an actual remote roundtrip ++ httpretty.allow_net_connect = False + - # When I retrieve the peer certificate - certificate = socket.getpeercert() -- ++ try: ++ # Given a fake socket instance ++ socket = fakesock.socket() + - # Then it should return a hardcoded value - certificate.should.equal({ - u'notAfter': 'Sep 29 04:20:00 GMT', @@ -31,13 +32,6 @@ - (u'DNS', u'*') - ) - }) -+ try: -+ # Background: -+ dt.now.return_value = datetime(2013, 10, 4, 4, 20, 0) -+ -+ # Given a fake socket instance -+ socket = fakesock.socket() -+ + # And that it's bound to some host + socket._host = 'somewhere.com' + diff --git a/python-httpretty.spec b/python-httpretty.spec index 6f3efce..79b3f1c 100644 --- a/python-httpretty.spec +++ b/python-httpretty.spec @@ -15,9 +15,9 @@ %global run_tests 1 Name: python-httpretty -Version: 0.9.7 +Version: 1.0.2 # If github_date is defined, assume a post-release snapshot -Release: 2%{?github_date:.%{github_date}git%{shortcommit}}%{?dist} +Release: 1%{?github_date:.%{github_date}git%{shortcommit}}%{?dist} Summary: HTTP request mock tool for Python License: MIT @@ -30,6 +30,9 @@ Source0: %{pypi_source} # does a remote connection after PR #313) Patch1: python-httpretty-fakesock_getpeercert_noconnect.patch +# Remote access (these tests were skipped upstream in <= 0.9.7) +Patch2: skip-test_passthrough.patch + BuildArch: noarch %global _description\ @@ -56,6 +59,9 @@ BuildRequires: python%{?fedora:2}-requests BuildRequires: python%{?fedora:2}-sure BuildRequires: python%{?fedora:2}-urllib3 BuildRequires: python%{?fedora:2}-tornado +BuildRequires: python%{?fedora:2}-eventlet +BuildRequires: python%{?fedora:2}-freezegun +BuildRequires: python%{?fedora:2}-redis %if 0%{?epel} == 6 # Need unittest2 to get the 'skip' decorator BuildRequires: python-unittest2 @@ -80,6 +86,9 @@ BuildRequires: python%{python3_pkgversion}-requests BuildRequires: python%{python3_pkgversion}-sure BuildRequires: python%{python3_pkgversion}-urllib3 BuildRequires: python%{python3_pkgversion}-tornado +BuildRequires: python%{python3_pkgversion}-eventlet +BuildRequires: python%{python3_pkgversion}-freezegun +BuildRequires: python%{python3_pkgversion}-redis %description -n python3-httpretty Once upon a time a python developer wanted to use a RESTful API, everything was @@ -152,6 +161,9 @@ LANG=C.UTF-8 %{__python2} -m nose -v %changelog +* Fri Mar 27 2020 Jiri Popelka - 1.0.2-1 +- 1.0.2 + * Thu Jan 30 2020 Fedora Release Engineering - 0.9.7-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild diff --git a/skip-test_passthrough.patch b/skip-test_passthrough.patch new file mode 100644 index 0000000..37f4a74 --- /dev/null +++ b/skip-test_passthrough.patch @@ -0,0 +1,19 @@ +diff -up httpretty-1.0.2/tests/functional/test_passthrough.py.orig httpretty-1.0.2/tests/functional/test_passthrough.py +--- httpretty-1.0.2/tests/functional/test_passthrough.py.orig 2020-03-10 04:08:59.000000000 +0100 ++++ httpretty-1.0.2/tests/functional/test_passthrough.py 2020-03-27 11:40:51.716073339 +0100 +@@ -36,6 +36,7 @@ def http(): + return sess + + ++@skip + def test_http_passthrough(): + url = 'http://httpbin.org/status/200' + response1 = http().get(url) +@@ -58,6 +59,7 @@ def test_http_passthrough(): + (response4.content).should.equal(response1.content) + + ++@skip + def test_https_passthrough(): + url = 'https://raw.githubusercontent.com/gabrielfalcao/httpretty/master/COPYING' + diff --git a/sources b/sources index 636cb11..cf1bbc1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (httpretty-0.9.7.tar.gz) = 4a1cdfc09af14ab2bc6eec84ad0905103ffb48c3154b127f646b39ff131584a52b1fd56bfe7a41959fc68d64eff94a221f9bf5a159a3dbfb3535fe4ac76c6170 +SHA512 (httpretty-1.0.2.tar.gz) = f9ef1c82f4fe3a31696e06228cea512664c5118b3c32910d7810d1fcf16b05d31b9b55db7bb6bd64967aadb162a2952757627439769db9117164b8248de9049c