This commit is contained in:
Jiri Popelka 2020-03-27 11:45:44 +01:00
parent f83f289d82
commit da375d52de
No known key found for this signature in database
GPG Key ID: A3E9A812AAB73DA7
5 changed files with 50 additions and 24 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
/httpretty-0.9.5.tar.gz /httpretty-0.9.5.tar.gz
/httpretty-0.9.6.tar.gz /httpretty-0.9.6.tar.gz
/httpretty-0.9.7.tar.gz /httpretty-0.9.7.tar.gz
/httpretty-1.0.2.tar.gz

View File

@ -1,23 +1,24 @@
--- HTTPretty/tests/unit/test_core.py 2017-01-06 15:04:06.030520764 -0800 diff -up httpretty-1.0.2/tests/unit/test_core.py.orig httpretty-1.0.2/tests/unit/test_core.py
+++ HTTPretty/tests/unit/test_core.py.new 2017-01-06 15:37:17.932752818 -0800 --- httpretty-1.0.2/tests/unit/test_core.py.orig 2020-03-20 01:54:16.000000000 +0100
@@ -192,31 +192,37 @@ +++ httpretty-1.0.2/tests/unit/test_core.py 2020-03-27 11:14:13.000000000 +0100
@patch('httpretty.core.datetime') @@ -190,28 +190,35 @@ def test_fake_ssl_socket_proxies_its_ow_
def test_fakesock_socket_getpeercert(dt): @freeze_time("2013-10-04 04:20:00")
def test_fakesock_socket_getpeercert():
("fakesock.socket#getpeercert should return a hardcoded fake certificate") ("fakesock.socket#getpeercert should return a hardcoded fake certificate")
- # Background: - # Given a fake socket instance
- dt.now.return_value = datetime(2013, 10, 4, 4, 20, 0) - socket = fakesock.socket()
- # And that it's bound to some host
- socket._host = 'somewhere.com'
+ # Don't bother with an actual remote roundtrip + # Don't bother with an actual remote roundtrip
+ httpretty.allow_net_connect = False + 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'
-
- # When I retrieve the peer certificate - # When I retrieve the peer certificate
- certificate = socket.getpeercert() - certificate = socket.getpeercert()
- + try:
+ # Given a fake socket instance
+ socket = fakesock.socket()
- # Then it should return a hardcoded value - # Then it should return a hardcoded value
- certificate.should.equal({ - certificate.should.equal({
- u'notAfter': 'Sep 29 04:20:00 GMT', - u'notAfter': 'Sep 29 04:20:00 GMT',
@ -31,13 +32,6 @@
- (u'DNS', u'*') - (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 + # And that it's bound to some host
+ socket._host = 'somewhere.com' + socket._host = 'somewhere.com'
+ +

View File

@ -15,9 +15,9 @@
%global run_tests 1 %global run_tests 1
Name: python-httpretty Name: python-httpretty
Version: 0.9.7 Version: 1.0.2
# If github_date is defined, assume a post-release snapshot # 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 Summary: HTTP request mock tool for Python
License: MIT License: MIT
@ -30,6 +30,9 @@ Source0: %{pypi_source}
# does a remote connection after PR #313) # does a remote connection after PR #313)
Patch1: python-httpretty-fakesock_getpeercert_noconnect.patch 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 BuildArch: noarch
%global _description\ %global _description\
@ -56,6 +59,9 @@ BuildRequires: python%{?fedora:2}-requests
BuildRequires: python%{?fedora:2}-sure BuildRequires: python%{?fedora:2}-sure
BuildRequires: python%{?fedora:2}-urllib3 BuildRequires: python%{?fedora:2}-urllib3
BuildRequires: python%{?fedora:2}-tornado BuildRequires: python%{?fedora:2}-tornado
BuildRequires: python%{?fedora:2}-eventlet
BuildRequires: python%{?fedora:2}-freezegun
BuildRequires: python%{?fedora:2}-redis
%if 0%{?epel} == 6 %if 0%{?epel} == 6
# Need unittest2 to get the 'skip' decorator # Need unittest2 to get the 'skip' decorator
BuildRequires: python-unittest2 BuildRequires: python-unittest2
@ -80,6 +86,9 @@ BuildRequires: python%{python3_pkgversion}-requests
BuildRequires: python%{python3_pkgversion}-sure BuildRequires: python%{python3_pkgversion}-sure
BuildRequires: python%{python3_pkgversion}-urllib3 BuildRequires: python%{python3_pkgversion}-urllib3
BuildRequires: python%{python3_pkgversion}-tornado BuildRequires: python%{python3_pkgversion}-tornado
BuildRequires: python%{python3_pkgversion}-eventlet
BuildRequires: python%{python3_pkgversion}-freezegun
BuildRequires: python%{python3_pkgversion}-redis
%description -n python3-httpretty %description -n python3-httpretty
Once upon a time a python developer wanted to use a RESTful API, everything was 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 %changelog
* Fri Mar 27 2020 Jiri Popelka <jpopelka@redhat.com> - 1.0.2-1
- 1.0.2
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.7-2 * Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

View File

@ -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'

View File

@ -1 +1 @@
SHA512 (httpretty-0.9.7.tar.gz) = 4a1cdfc09af14ab2bc6eec84ad0905103ffb48c3154b127f646b39ff131584a52b1fd56bfe7a41959fc68d64eff94a221f9bf5a159a3dbfb3535fe4ac76c6170 SHA512 (httpretty-1.0.2.tar.gz) = f9ef1c82f4fe3a31696e06228cea512664c5118b3c32910d7810d1fcf16b05d31b9b55db7bb6bd64967aadb162a2952757627439769db9117164b8248de9049c