2013-09-03 09:27:43 +02:00
|
|
|
#
|
|
|
|
# spec file for package python-httpretty
|
|
|
|
#
|
2024-03-07 19:02:41 +01:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2013-09-03 09:27:43 +02: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 14:32:33 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2013-09-26 15:30:49 +02:00
|
|
|
#
|
2013-09-03 09:27:43 +02:00
|
|
|
|
|
|
|
|
2023-06-14 08:58:24 +02:00
|
|
|
%{?sle15_python_module_pythons}
|
2023-12-31 13:33:16 +01:00
|
|
|
%if 0%{?suse_version} < 1550
|
|
|
|
%bcond_with boto3
|
|
|
|
%else
|
|
|
|
%bcond_without boto3
|
|
|
|
%endif
|
2013-09-03 09:27:43 +02:00
|
|
|
Name: python-httpretty
|
2022-03-14 11:53:11 +01:00
|
|
|
Version: 1.1.4
|
2013-09-03 09:27:43 +02:00
|
|
|
Release: 0
|
2017-08-28 06:14:10 +02:00
|
|
|
Summary: HTTP client mocking tool for Python
|
2013-09-26 15:30:49 +02:00
|
|
|
License: MIT
|
2018-12-04 18:14:36 +01:00
|
|
|
URL: https://github.com/gabrielfalcao/HTTPretty
|
2017-08-21 09:57:56 +02:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/h/httpretty/httpretty-%{version}.tar.gz
|
2022-05-05 09:54:38 +02:00
|
|
|
Patch0: remove-mock.patch
|
2022-08-06 19:33:07 +02: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 04:55:49 +02: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 19:01:22 +02:00
|
|
|
#PATCH-FIX-UPSTREAM 460-fix-tests-two-miliseconds
|
|
|
|
Patch3: 460-miliseconds_tests.patch
|
2023-03-30 06:23:11 +02:00
|
|
|
# PATCH-FIX-OPENSUSE Relax the time for one test case from 2ms to 3ms.
|
|
|
|
Patch4: relax-test-callback-response.patch
|
2024-03-22 10:51:19 +01:00
|
|
|
# PATCH-FIX-UPSTREAM https://github.com/gabrielfalcao/HTTPretty/pull/480
|
|
|
|
Patch5: 0001-Fix-test_417_openssl.py-if-pyOpenSSL-not-available.patch
|
2023-12-31 13:33:16 +01:00
|
|
|
%if %{with boto3}
|
2022-08-06 19:33:07 +02:00
|
|
|
BuildRequires: %{python_module boto3}
|
2023-12-31 13:33:16 +01:00
|
|
|
%endif
|
2020-04-09 15:15:01 +02:00
|
|
|
BuildRequires: %{python_module eventlet}
|
|
|
|
BuildRequires: %{python_module fakeredis}
|
|
|
|
BuildRequires: %{python_module freezegun}
|
2019-01-07 09:29:52 +01:00
|
|
|
BuildRequires: %{python_module httplib2}
|
2022-08-06 19:33:07 +02:00
|
|
|
BuildRequires: %{python_module pytest-httpserver}
|
|
|
|
BuildRequires: %{python_module pytest}
|
2019-01-07 09:29:52 +01:00
|
|
|
BuildRequires: %{python_module requests}
|
2017-08-21 09:57:56 +02:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2019-01-07 09:29:52 +01:00
|
|
|
BuildRequires: %{python_module sure}
|
|
|
|
BuildRequires: %{python_module tornado}
|
2024-03-07 19:02:41 +01:00
|
|
|
BuildRequires: %{python_module urllib3}
|
2017-08-21 09:57:56 +02:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
2013-09-03 09:27:43 +02:00
|
|
|
BuildArch: noarch
|
2017-08-21 09:57:56 +02:00
|
|
|
%python_subpackages
|
2013-09-03 09:27:43 +02:00
|
|
|
|
|
|
|
%description
|
2017-08-28 06:14:10 +02:00
|
|
|
This library allows mocking of HTTP protocol based
|
2013-09-03 09:27:43 +02:00
|
|
|
unit tests.
|
2017-08-28 06:14:10 +02:00
|
|
|
It is similar to Ruby's FakeWeb.
|
2013-09-03 09:27:43 +02:00
|
|
|
|
|
|
|
%prep
|
2022-05-05 09:54:38 +02:00
|
|
|
%autosetup -p1 -n httpretty-%{version}
|
2023-12-31 13:33:16 +01:00
|
|
|
%if !%{with boto3}
|
|
|
|
rm tests/bugfixes/nosetests/test_416_boto3.py
|
|
|
|
%endif
|
2013-09-03 09:27:43 +02:00
|
|
|
|
|
|
|
%build
|
2017-08-21 09:57:56 +02:00
|
|
|
%python_build
|
2014-02-17 11:09:26 +01:00
|
|
|
|
2020-08-17 08:28:34 +02:00
|
|
|
%install
|
|
|
|
%python_install
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
2014-02-17 11:09:26 +01:00
|
|
|
%check
|
2022-08-06 19:34:11 +02:00
|
|
|
# gh#gabrielfalcao/HTTPretty#405
|
2020-08-12 14:31:30 +02:00
|
|
|
export EVENTLET_NO_GREENDNS=yes
|
2022-08-09 09:33:32 +02:00
|
|
|
# needs internet connection to httpbin.org
|
|
|
|
donttest="test_http_passthrough or test_https_passthrough"
|
|
|
|
# flaky (too slow) on obs
|
2023-05-16 09:35:48 +02:00
|
|
|
donttest="$donttest or test_httpretty_should_allow_forcing_headers_urllib2 or test_httpretty_should_allow_registering_regexes_with_streaming_responses"
|
2024-05-23 13:40:10 +02:00
|
|
|
# gh#gabrielfalcao/HTTPretty#457
|
|
|
|
donttest="$donttest or test_httpretty_should_handle_paths_starting_with_two_slashes"
|
2022-08-09 09:33:32 +02:00
|
|
|
%pytest -k "not (${donttest})"
|
2017-08-21 09:57:56 +02:00
|
|
|
|
|
|
|
%files %{python_files}
|
2018-12-04 18:14:36 +01:00
|
|
|
%license COPYING
|
|
|
|
%doc README.rst
|
2016-03-13 22:05:43 +01:00
|
|
|
%{python_sitelib}/httpretty
|
2021-03-22 23:19:58 +01:00
|
|
|
%{python_sitelib}/httpretty-%{version}*-info
|
2013-09-03 09:27:43 +02:00
|
|
|
|
|
|
|
%changelog
|