python-httpretty package is retired on branch c10s for BAKERY-412

This commit is contained in:
Troy Dawson 2024-03-21 19:25:36 +00:00
parent aa86e03068
commit 6951a84f55
9 changed files with 1 additions and 486 deletions

11
.gitignore vendored
View File

@ -1,11 +0,0 @@
/httpretty-0.8.3.tar.gz
/HTTPretty-70af1f8.tar.gz
/httpretty-0.9.5.tar.gz
/httpretty-0.9.6.tar.gz
/httpretty-0.9.7.tar.gz
/httpretty-1.0.2.tar.gz
/httpretty-1.0.5.tar.gz
/httpretty-1.1.0.tar.gz
/httpretty-1.1.2.tar.gz
/httpretty-1.1.3.tar.gz
/httpretty-1.1.4.tar.gz

144
changelog
View File

@ -1,144 +0,0 @@
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Aug 19 2021 Jiri Popelka <jpopelka@redhat.com> - 1.1.4-1
- 1.1.4
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Mon Jun 07 2021 Miro Hrončok <mhroncok@redhat.com>
- Fallback to WARNING when logging.getLogger().level is None
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 1.1.3-2
- Rebuilt for Python 3.10
* Tue May 25 2021 Jiri Popelka <jpopelka@redhat.com> - 1.1.3-1
- 1.1.3
* Mon May 24 2021 Jiri Popelka <jpopelka@redhat.com> - 1.1.2-1
- 1.1.2
* Thu May 13 2021 Jiri Popelka <jpopelka@redhat.com> - 1.1.0-1
- 1.1.0
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Jan 6 2021 Jiri Popelka <jpopelka@redhat.com> - 1.0.5-1
- 1.0.5
- Enable tests for F34 (#1896191 has been resolved)
* Tue Oct 13 2020 Jiri Popelka <jpopelka@redhat.com> - 1.0.2-4
- Temporarily run tests on Fedora < 34 only
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Sun May 24 2020 Miro Hrončok <mhroncok@redhat.com> - 1.0.2-2
- Rebuilt for Python 3.9
* 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
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Wed Jan 08 2020 Charalampos Stratakis <cstratak@redhat.com> - 0.9.7-1
- Update to 0.9.7 (rhbz#1759992)
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.9.6-4
- Rebuilt for Python 3.8.0rc1 (#1748018)
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.9.6-3
- Rebuilt for Python 3.8
* Tue Aug 06 2019 Jiri Popelka <jpopelka@redhat.com> - 0.9.6-2
- Escape macro in comment
* Tue Jul 30 2019 Jiri Popelka <jpopelka@redhat.com> - 0.9.6-1
- Update to 0.9.6
- Disable python2 subpackage on F30+
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.5-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.5-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Sun Nov 18 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.9.5-4
- Drop explicit locale setting for python3, use C.UTF-8 for python2
See https://fedoraproject.org/wiki/Changes/Remove_glibc-langpacks-all_from_buildroot
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Mon Jun 18 2018 Miro Hrončok <mhroncok@redhat.com> - 0.9.5-2
- Rebuilt for Python 3.7
* Wed Jun 06 2018 Miro Hrončok <mhroncok@redhat.com> - 0.9.5-1
- Update to 0.9.5, fix for Python 3.7 (#1580060)
* Sat May 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.9.4-1
- Update to 0.9.4 (#1572888)
* Wed Feb 21 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.8.14-8.20161011git70af1f8
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.14-7.20161011git70af1f8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Fri Sep 29 2017 Troy Dawson <tdawson@redhat.com> - 0.8.14-6.20161011git70af1f8
- Cleanup spec file conditionals
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.8.14-5.20161011git70af1f8
- Python 2 binary package renamed to python2-httpretty
See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.14-4.20161011git70af1f8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.14-3.20161011git70af1f8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Fri Jan 27 2017 Adam Williamson <awilliam@redhat.com> - 0.8.14-2.20161011git70af1f8
- Backport PR #317 (call reset from setUp / tearDown) - thanks gholms
* Fri Jan 06 2017 Adam Williamson <awilliam@redhat.com> - 0.8.14-1.20161011git70af1f8
- Update to current git master (as a 0.8.14 post-release snapshot)
- Backport PR #313 (fix with recent OpenSSL, requests and urllib3)
- Backport PR #314 (fix a test with Python 3)
- Backport PR #315 (fix some issues with urllib 1.10, as found in RHEL 6)
- Avoid an unnecessary remote roundtrip in one of the tests
- Replace dependency 'un-pinning' patch with some sed commands in the spec
- Replace ASCII patch by running setup.py with a UTF-8 LANG
- Enable the tests, with necessary buildrequires
* Tue Dec 13 2016 Charalampos Stratakis <cstratak@redhat.com> - 0.8.3-8
- Rebuild for Python 3.6
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.3-7
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.3-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.3-5
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Mon Mar 02 2015 Jamie Lennox <jamielennox@redhat.com> - 0.8.3-3
- Added conditional __python2 macros for building on RHEL 6.
* Tue Feb 24 2015 Jamie Lennox <jamielennox@redhat.com> - 0.8.3-2
- Added with_python3 build flags to enable building on EPEL.
* Mon Jul 28 2014 Jamie Lennox <jamielennox@redhat.com> - 0.8.3-1
- Updated to new version.
- Removed check, there are simply too many problems upstream.
* Mon Mar 10 2014 Jamie Lennox <jamielennox@redhat.com> - 0.8.0-1
- Initial package.

1
dead.package Normal file
View File

@ -0,0 +1 @@
python-httpretty package is retired on branch c10s for BAKERY-412

View File

@ -1,79 +0,0 @@
From d1e3fa6a2b96344636b0f891b36142526baa26df Mon Sep 17 00:00:00 2001
From: Jiri Popelka <jpopelka@redhat.com>
Date: Tue, 22 Jun 2021 18:09:21 +0200
Subject: [PATCH 1/2] Apply patch
python-httpretty-fakesock_getpeercert_noconnect.patch
patch_name: python-httpretty-fakesock_getpeercert_noconnect.patch
patch_id: 1
description: |-
Avoid unnecessary remote access requirement (note: test only actually
does a remote connection after PR #313)
---
tests/unit/test_core.py | 49 +++++++++++++++++++++++------------------
1 file changed, 28 insertions(+), 21 deletions(-)
diff --git a/tests/unit/test_core.py b/tests/unit/test_core.py
index 80c4a86..dd59248 100644
--- a/tests/unit/test_core.py
+++ b/tests/unit/test_core.py
@@ -191,28 +191,35 @@ def test_fake_ssl_socket_proxies_its_ow_socket():
@freeze_time("2013-10-04 04:20:00")
def test_fakesock_socket_getpeercert():
("fakesock.socket#getpeercert should return a hardcoded fake certificate")
- # 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
- certificate = socket.getpeercert()
-
- # Then it should return a hardcoded value
- certificate.should.equal({
- u'notAfter': 'Sep 29 04:20:00 GMT',
- u'subject': (
- ((u'organizationName', u'*.somewhere.com'),),
- ((u'organizationalUnitName', u'Domain Control Validated'),),
- ((u'commonName', u'*.somewhere.com'),)),
- u'subjectAltName': (
- (u'DNS', u'*.somewhere.com'),
- (u'DNS', u'somewhere.com'),
- (u'DNS', u'*')
- )
- })
+ # Don't bother with an actual remote roundtrip
+ httpretty.allow_net_connect = False
+
+ try:
+ # 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
+ certificate = socket.getpeercert()
+
+ # Then it should return a hardcoded value
+ certificate.should.equal({
+ u'notAfter': 'Sep 29 04:20:00 GMT',
+ u'subject': (
+ ((u'organizationName', u'*.somewhere.com'),),
+ ((u'organizationalUnitName', u'Domain Control Validated'),),
+ ((u'commonName', u'*.somewhere.com'),)),
+ u'subjectAltName': (
+ (u'DNS', u'*.somewhere.com'),
+ (u'DNS', u'somewhere.com'),
+ (u'DNS', u'*')
+ )
+ })
+ finally:
+ httpretty.allow_net_connect = True
def test_fakesock_socket_ssl():
--
2.31.1

View File

@ -1,97 +0,0 @@
%global github_owner gabrielfalcao
%global github_name HTTPretty
%global srcname httpretty
%if 0%{?fedora}
%global run_tests 1
%else
# missing deps in epel9
%global run_tests 0
%endif
Name: python-httpretty
Version: 1.1.4
Release: %autorelease
Summary: HTTP request mock tool for Python
License: MIT
URL: https://github.com/%{github_owner}/%{github_name}
Source0: %{pypi_source}
# Avoid unnecessary remote access requirement (note: test only actually
# 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
# Remove timeout, which causes some tests to fail in Koji
#
# Fixes RHBZ#2046877
Patch3: test_response-no-within.patch
# https://github.com/gabrielfalcao/HTTPretty/issues/457
Patch4: test_handle_slashes.patch
BuildArch: noarch
%global _description\
Once upon a time a python developer wanted to use a RESTful API, everything was\
fine but until the day he needed to test the code that hits the RESTful API:\
what if the API server is down? What if its content has changed?\
Don't worry, HTTPretty is here for you.
%description %_description
%package -n python3-httpretty
Summary: HTTP request mock tool for Python 3
Requires: python3-six
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%if %{run_tests}
BuildRequires: python3-httplib2
BuildRequires: python3-mock
BuildRequires: python3-nose
BuildRequires: python3-requests
BuildRequires: python3-sure
BuildRequires: python3-urllib3
BuildRequires: python3-tornado
BuildRequires: python3-eventlet
BuildRequires: python3-freezegun
BuildRequires: python3-redis
%endif
%description -n python3-httpretty
Once upon a time a python developer wanted to use a RESTful API, everything was
fine but until the day he needed to test the code that hits the RESTful API:
what if the API server is down? What if its content has changed?
Don't worry, HTTPretty is here for you.
%prep
%autosetup -n httpretty-%{version} -p1
# Alternative for building from commit tarball
#autosetup -n %%{github_name}-%%{github_commit} -p1
# nose plugins we don't have yet
sed -i 's/^with-randomly = 1$//' setup.cfg
sed -i 's/^rednose = 1$//' setup.cfg
%build
%py3_build
%install
%py3_install
%check
%if %{run_tests}
%{__python3} -m nose -v
%endif
%files -n python3-httpretty
%doc README.rst
%license COPYING
%{python3_sitelib}/httpretty
%{python3_sitelib}/httpretty-%{version}-py%{python3_version}.egg-info
%changelog
%autochangelog

View File

@ -1,44 +0,0 @@
From 683a5216502be770ad21a7dc616acdec70d77f68 Mon Sep 17 00:00:00 2001
From: Jiri Popelka <jpopelka@redhat.com>
Date: Tue, 22 Jun 2021 18:09:22 +0200
Subject: [PATCH 2/2] Apply patch skip-test_passthrough.patch
patch_name: skip-test_passthrough.patch
patch_id: 2
description: |-
Remote access (these tests were skipped upstream in <= 0.9.7)
---
tests/functional/test_passthrough.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tests/functional/test_passthrough.py b/tests/functional/test_passthrough.py
index 47c9e79..7a77d23 100644
--- a/tests/functional/test_passthrough.py
+++ b/tests/functional/test_passthrough.py
@@ -24,6 +24,7 @@
import requests
import httpretty
+from unittest import skip
from sure import expect
@@ -35,6 +36,7 @@ def http():
return sess
+@skip
def test_http_passthrough():
url = 'http://httpbin.org/status/200'
response1 = http().get(url)
@@ -57,6 +59,7 @@ def test_http_passthrough():
(response4.content).should.equal(response1.content)
+@skip
def test_https_passthrough():
url = 'https://httpbin.org/status/200'
--
2.31.1

View File

@ -1 +0,0 @@
SHA512 (httpretty-1.1.4.tar.gz) = 4daceea4f30ce181e871167d304bd7af9d504364f55d42f8025770f2efe7e833d018aed681c8733d653d4de90db3433e999c56bccd4675f81e66d1cc4023e418

View File

@ -1,28 +0,0 @@
From 44a9b748a24253fb483f3338f7ae145ca90b7178 Mon Sep 17 00:00:00 2001
From: Jiri Popelka <jpopelka@redhat.com>
Date: Wed, 3 Aug 2022 15:51:54 +0200
Subject: [PATCH 4/4] Update
test_httpretty_should_handle_paths_starting_with_two_slashes
http.server.BaseHTTPRequestHandler.parse_request() now replaces '//' with '/'.
https://github.com/python/cpython/pull/93879
Patch-name: test_handle_slashes.patch
Patch-status: https://github.com/gabrielfalcao/HTTPretty/issues/457
---
tests/functional/test_requests.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/functional/test_requests.py b/tests/functional/test_requests.py
index 752428b..59e36b0 100644
--- a/tests/functional/test_requests.py
+++ b/tests/functional/test_requests.py
@@ -946,4 +946,4 @@ def test_httpretty_should_handle_paths_starting_with_two_slashes():
response = requests.get('http://example.com//foo')
expect(response.text).to.equal('Find the best foo')
expect(HTTPretty.last_request.method).to.equal('GET')
- expect(HTTPretty.last_request.path).to.equal('//foo')
+ expect(HTTPretty.last_request.path).to.equal('/foo')
--
2.37.1

View File

@ -1,82 +0,0 @@
From 2492bd27ee8d55146d9d94875ce058b7b119b284 Mon Sep 17 00:00:00 2001
From: Jiri Popelka <jpopelka@redhat.com>
Date: Fri, 4 Feb 2022 15:53:56 +0100
Subject: [PATCH 3/3] Remove timeout, which causes some tests to fail in Koji
Fixes RHBZ#2046877
Patch-name: test_response-no-within.patch
---
tests/functional/test_httplib2.py | 9 +++------
tests/functional/test_urllib2.py | 7 ++-----
2 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/tests/functional/test_httplib2.py b/tests/functional/test_httplib2.py
index c913d8a..0f7e31b 100644
--- a/tests/functional/test_httplib2.py
+++ b/tests/functional/test_httplib2.py
@@ -112,8 +112,7 @@ def test_httpretty_should_allow_adding_and_overwritting_httplib2():
@httprettified
-@within(two=miliseconds)
-def test_httpretty_should_allow_forcing_headers_httplib2(now):
+def test_httpretty_should_allow_forcing_headers_httplib2():
"HTTPretty should allow forcing headers with httplib2"
HTTPretty.register_uri(HTTPretty.GET, "http://github.com/foo",
@@ -165,8 +164,7 @@ def test_httpretty_should_allow_adding_and_overwritting_by_kwargs_u2():
@httprettified
-@within(two=miliseconds)
-def test_rotating_responses_with_httplib2(now):
+def test_rotating_responses_with_httplib2():
"HTTPretty should support rotating responses with httplib2"
HTTPretty.register_uri(
@@ -263,8 +261,7 @@ def test_httpretty_ignores_querystrings_from_registered_uri(now):
@httprettified
-@within(two=miliseconds)
-def test_callback_response(now):
+def test_callback_response():
("HTTPretty should call a callback function to be set as the body with"
" httplib2")
diff --git a/tests/functional/test_urllib2.py b/tests/functional/test_urllib2.py
index 9c8ff39..4cba725 100644
--- a/tests/functional/test_urllib2.py
+++ b/tests/functional/test_urllib2.py
@@ -127,7 +127,6 @@ def test_httpretty_should_allow_adding_and_overwritting_urllib2():
@httprettified
-@within(two=miliseconds)
def test_httpretty_should_allow_forcing_headers_urllib2():
"HTTPretty should allow forcing headers with urllib2"
@@ -177,8 +176,7 @@ def test_httpretty_should_allow_adding_and_overwritting_by_kwargs_u2():
@httprettified
-@within(two=miliseconds)
-def test_httpretty_should_support_a_list_of_successive_responses_urllib2(now):
+def test_httpretty_should_support_a_list_of_successive_responses_urllib2():
("HTTPretty should support adding a list of successive "
"responses with urllib2")
@@ -285,8 +283,7 @@ def test_httpretty_ignores_querystrings_from_registered_uri():
@httprettified
-@within(two=miliseconds)
-def test_callback_response(now):
+def test_callback_response():
("HTTPretty should call a callback function to be set as the body with"
" urllib2")
--
2.34.1