2013-09-03 07:27:43 +00:00
|
|
|
#
|
|
|
|
|
# spec file for package python-httpretty
|
|
|
|
|
#
|
2025-05-28 06:03:24 +00:00
|
|
|
# Copyright (c) 2025 SUSE LLC
|
2013-09-03 07:27:43 +00:00
|
|
|
#
|
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
2018-12-04 13:32:33 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2013-09-26 13:30:49 +00:00
|
|
|
#
|
2013-09-03 07:27:43 +00:00
|
|
|
|
|
|
|
|
|
2023-06-14 06:58:24 +00:00
|
|
|
%{?sle15_python_module_pythons}
|
2023-12-31 12:33:16 +00:00
|
|
|
%if 0%{?suse_version} < 1550
|
|
|
|
|
%bcond_with boto3
|
|
|
|
|
%else
|
|
|
|
|
%bcond_without boto3
|
|
|
|
|
%endif
|
2013-09-03 07:27:43 +00:00
|
|
|
Name: python-httpretty
|
2022-03-14 10:53:11 +00:00
|
|
|
Version: 1.1.4
|
2013-09-03 07:27:43 +00:00
|
|
|
Release: 0
|
2017-08-28 04:14:10 +00:00
|
|
|
Summary: HTTP client mocking tool for Python
|
2013-09-26 13:30:49 +00:00
|
|
|
License: MIT
|
2018-12-04 17:14:36 +00:00
|
|
|
URL: https://github.com/gabrielfalcao/HTTPretty
|
2017-08-21 07:57:56 +00:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/h/httpretty/httpretty-%{version}.tar.gz
|
2022-05-05 07:54:38 +00:00
|
|
|
Patch0: remove-mock.patch
|
2022-08-06 17:33:07 +00:00
|
|
|
# PATCH-FIX-UPSTREAM 453-fix-tests-pytest.patch gh#gabrielfalcao/HTTPretty#449 mcepl@suse.com
|
|
|
|
|
# Make tests compatible with pytest
|
|
|
|
|
Patch1: 453-fix-tests-pytest.patch
|
2022-08-08 02:55:49 +00:00
|
|
|
# PATCH-FIX-OPENSUSE test_double_slash may be replaced with / from stdlib
|
|
|
|
|
# gh#gabrielfalcao/HTTPretty#457
|
|
|
|
|
Patch2: double-slash-paths.patch
|
2022-10-27 17:01:22 +00:00
|
|
|
#PATCH-FIX-UPSTREAM 460-fix-tests-two-miliseconds
|
|
|
|
|
Patch3: 460-miliseconds_tests.patch
|
2023-03-30 04:23:11 +00:00
|
|
|
# PATCH-FIX-OPENSUSE Relax the time for one test case from 2ms to 3ms.
|
|
|
|
|
Patch4: relax-test-callback-response.patch
|
2024-03-22 09:51:19 +00:00
|
|
|
# PATCH-FIX-UPSTREAM https://github.com/gabrielfalcao/HTTPretty/pull/480
|
|
|
|
|
Patch5: 0001-Fix-test_417_openssl.py-if-pyOpenSSL-not-available.patch
|
2025-05-28 06:03:24 +00:00
|
|
|
# PATCH-FIX-UPSTREAM https://github.com/gabrielfalcao/HTTPretty/pull/485
|
|
|
|
|
Patch6: 0001-Mock-socket.shutdown-for-compatibility-with-urllib3-.patch
|
2023-12-31 12:33:16 +00:00
|
|
|
%if %{with boto3}
|
2022-08-06 17:33:07 +00:00
|
|
|
BuildRequires: %{python_module boto3}
|
2023-12-31 12:33:16 +00:00
|
|
|
%endif
|
2020-04-09 13:15:01 +00:00
|
|
|
BuildRequires: %{python_module eventlet}
|
|
|
|
|
BuildRequires: %{python_module fakeredis}
|
|
|
|
|
BuildRequires: %{python_module freezegun}
|
2019-01-07 08:29:52 +00:00
|
|
|
BuildRequires: %{python_module httplib2}
|
2025-07-07 02:33:05 +00:00
|
|
|
BuildRequires: %{python_module pip}
|
2022-08-06 17:33:07 +00:00
|
|
|
BuildRequires: %{python_module pytest-httpserver}
|
|
|
|
|
BuildRequires: %{python_module pytest}
|
2019-01-07 08:29:52 +00:00
|
|
|
BuildRequires: %{python_module requests}
|
2017-08-21 07:57:56 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2019-01-07 08:29:52 +00:00
|
|
|
BuildRequires: %{python_module sure}
|
|
|
|
|
BuildRequires: %{python_module tornado}
|
2024-03-07 18:02:41 +00:00
|
|
|
BuildRequires: %{python_module urllib3}
|
2025-07-07 02:33:05 +00:00
|
|
|
BuildRequires: %{python_module wheel}
|
2017-08-21 07:57:56 +00:00
|
|
|
BuildRequires: fdupes
|
|
|
|
|
BuildRequires: python-rpm-macros
|
2013-09-03 07:27:43 +00:00
|
|
|
BuildArch: noarch
|
2017-08-21 07:57:56 +00:00
|
|
|
%python_subpackages
|
2013-09-03 07:27:43 +00:00
|
|
|
|
|
|
|
|
%description
|
2017-08-28 04:14:10 +00:00
|
|
|
This library allows mocking of HTTP protocol based
|
2013-09-03 07:27:43 +00:00
|
|
|
unit tests.
|
2017-08-28 04:14:10 +00:00
|
|
|
It is similar to Ruby's FakeWeb.
|
2013-09-03 07:27:43 +00:00
|
|
|
|
|
|
|
|
%prep
|
2022-05-05 07:54:38 +00:00
|
|
|
%autosetup -p1 -n httpretty-%{version}
|
2023-12-31 12:33:16 +00:00
|
|
|
%if !%{with boto3}
|
|
|
|
|
rm tests/bugfixes/nosetests/test_416_boto3.py
|
|
|
|
|
%endif
|
2013-09-03 07:27:43 +00:00
|
|
|
|
|
|
|
|
%build
|
2025-07-07 02:33:05 +00:00
|
|
|
%pyproject_wheel
|
2014-02-17 10:09:26 +00:00
|
|
|
|
2020-08-17 06:28:34 +00:00
|
|
|
%install
|
2025-07-07 02:33:05 +00:00
|
|
|
%pyproject_install
|
2020-08-17 06:28:34 +00:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
|
2014-02-17 10:09:26 +00:00
|
|
|
%check
|
2022-08-06 17:34:11 +00:00
|
|
|
# gh#gabrielfalcao/HTTPretty#405
|
2020-08-12 12:31:30 +00:00
|
|
|
export EVENTLET_NO_GREENDNS=yes
|
2022-08-09 07:33:32 +00:00
|
|
|
# needs internet connection to httpbin.org
|
|
|
|
|
donttest="test_http_passthrough or test_https_passthrough"
|
|
|
|
|
# flaky (too slow) on obs
|
2025-01-22 09:11:32 +00:00
|
|
|
donttest="$donttest or test_httpretty_should_allow_forcing_headers_urllib2 or test_httpretty_should_allow_registering_regexes_with_streaming_responses or test_httpretty_provides_easy_access_to_querystrings"
|
2024-05-23 11:40:10 +00:00
|
|
|
# gh#gabrielfalcao/HTTPretty#457
|
|
|
|
|
donttest="$donttest or test_httpretty_should_handle_paths_starting_with_two_slashes"
|
2022-08-09 07:33:32 +00:00
|
|
|
%pytest -k "not (${donttest})"
|
2017-08-21 07:57:56 +00:00
|
|
|
|
|
|
|
|
%files %{python_files}
|
2018-12-04 17:14:36 +00:00
|
|
|
%license COPYING
|
|
|
|
|
%doc README.rst
|
2016-03-13 21:05:43 +00:00
|
|
|
%{python_sitelib}/httpretty
|
2025-07-07 02:33:05 +00:00
|
|
|
%{python_sitelib}/httpretty-%{version}.dist-info
|
2013-09-03 07:27:43 +00:00
|
|
|
|
|
|
|
|
%changelog
|