|
|
@ -1,8 +1,5 @@
|
|
|
|
%if 0%{?fedora} || 0%{?rhel} > 6
|
|
|
|
%bcond_without python3
|
|
|
|
# keeping python3 subpackage as stdlib mock lives in a different namespace
|
|
|
|
%bcond_with tests
|
|
|
|
# Some people may have not fixed their imports
|
|
|
|
|
|
|
|
%global with_python3 1
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Not yet in Fedora buildroot
|
|
|
|
# Not yet in Fedora buildroot
|
|
|
|
%{!?python3_pkgversion:%global python3_pkgversion 3}
|
|
|
|
%{!?python3_pkgversion:%global python3_pkgversion 3}
|
|
|
@ -11,21 +8,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
Name: python-mock
|
|
|
|
Name: python-mock
|
|
|
|
Version: 2.0.0
|
|
|
|
Version: 2.0.0
|
|
|
|
Release: 11%{?dist}
|
|
|
|
Release: 13%{?dist}
|
|
|
|
Summary: A Python Mocking and Patching Library for Testing
|
|
|
|
Summary: A Python Mocking and Patching Library for Testing
|
|
|
|
|
|
|
|
|
|
|
|
License: BSD
|
|
|
|
License: BSD
|
|
|
|
URL: http://www.voidspace.org.uk/python/%{mod_name}/
|
|
|
|
URL: http://www.voidspace.org.uk/python/%{mod_name}/
|
|
|
|
Source0: http://pypi.python.org/packages/source/m/%{mod_name}/%{mod_name}-%{version}.tar.gz
|
|
|
|
Source0: https://pypi.python.org/packages/source/m/%{mod_name}/%{mod_name}-%{version}.tar.gz
|
|
|
|
Patch0: 0001-Remove-pbr-dependency.patch
|
|
|
|
Patch0: 0001-Remove-pbr-dependency.patch
|
|
|
|
|
|
|
|
|
|
|
|
BuildArch: noarch
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
BuildRequires: python2-devel
|
|
|
|
|
|
|
|
BuildRequires: python2-setuptools
|
|
|
|
|
|
|
|
BuildRequires: python2-funcsigs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%if %{with python3}
|
|
|
|
BuildRequires: python%{python3_pkgversion}-devel
|
|
|
|
BuildRequires: python%{python3_pkgversion}-devel
|
|
|
|
BuildRequires: python%{python3_pkgversion}-setuptools
|
|
|
|
BuildRequires: python%{python3_pkgversion}-setuptools
|
|
|
|
|
|
|
|
%if %{with tests}
|
|
|
|
# For tests
|
|
|
|
# For tests
|
|
|
|
BuildRequires: python%{python3_pkgversion}-unittest2
|
|
|
|
BuildRequires: python%{python3_pkgversion}-unittest2
|
|
|
|
BuildRequires: python%{python3_pkgversion}-six
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
%description
|
|
|
@ -35,6 +38,19 @@ action, you can make assertions about which methods / attributes were used and
|
|
|
|
arguments they were called with. You can also specify return values and set
|
|
|
|
arguments they were called with. You can also specify return values and set
|
|
|
|
needed attributes in the normal way.
|
|
|
|
needed attributes in the normal way.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%package -n python2-mock
|
|
|
|
|
|
|
|
Summary: A Python Mocking and Patching Library for Testing
|
|
|
|
|
|
|
|
%{?python_provide:%python_provide python2-%{mod_name}}
|
|
|
|
|
|
|
|
Requires: python2-funcsigs
|
|
|
|
|
|
|
|
Requires: python2-six >= 1.9.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%description -n python2-mock
|
|
|
|
|
|
|
|
Mock is a Python module that provides a core mock class. It removes the need
|
|
|
|
|
|
|
|
to create a host of stubs throughout your test suite. After performing an
|
|
|
|
|
|
|
|
action, you can make assertions about which methods / attributes were used and
|
|
|
|
|
|
|
|
arguments they were called with. You can also specify return values and set
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%if %{with python3}
|
|
|
|
%package -n python%{python3_pkgversion}-mock
|
|
|
|
%package -n python%{python3_pkgversion}-mock
|
|
|
|
Summary: A Python Mocking and Patching Library for Testing
|
|
|
|
Summary: A Python Mocking and Patching Library for Testing
|
|
|
|
%{?python_provide:%python_provide python%{python3_pkgversion}-%{mod_name}}
|
|
|
|
%{?python_provide:%python_provide python%{python3_pkgversion}-%{mod_name}}
|
|
|
@ -46,6 +62,7 @@ to create a host of stubs throughout your test suite. After performing an
|
|
|
|
action, you can make assertions about which methods / attributes were used and
|
|
|
|
action, you can make assertions about which methods / attributes were used and
|
|
|
|
arguments they were called with. You can also specify return values and set
|
|
|
|
arguments they were called with. You can also specify return values and set
|
|
|
|
needed attributes in the normal way.
|
|
|
|
needed attributes in the normal way.
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%prep
|
|
|
@ -54,17 +71,34 @@ needed attributes in the normal way.
|
|
|
|
sed -i "s|VERSIONPLACEHOLDER|%{version}|" setup.cfg mock/mock.py
|
|
|
|
sed -i "s|VERSIONPLACEHOLDER|%{version}|" setup.cfg mock/mock.py
|
|
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
%build
|
|
|
|
|
|
|
|
%{py2_build}
|
|
|
|
|
|
|
|
%if %{with python3}
|
|
|
|
%{py3_build}
|
|
|
|
%{py3_build}
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
%check
|
|
|
|
%{__python3} -m unittest
|
|
|
|
%if %{with tests}
|
|
|
|
|
|
|
|
%if %{with python3}
|
|
|
|
|
|
|
|
# Few failing tests but keep output
|
|
|
|
|
|
|
|
%{__python3} setup.py test ||:
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
%install
|
|
|
|
|
|
|
|
%if %{with python3}
|
|
|
|
%{py3_install}
|
|
|
|
%{py3_install}
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%{py2_install}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%if 0%{?with_python3}
|
|
|
|
%files -n python2-mock
|
|
|
|
|
|
|
|
%license LICENSE.txt
|
|
|
|
|
|
|
|
%doc docs/*
|
|
|
|
|
|
|
|
%{python2_sitelib}/*.egg-info
|
|
|
|
|
|
|
|
%{python2_sitelib}/%{mod_name}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%if %{with python3}
|
|
|
|
%files -n python%{python3_pkgversion}-mock
|
|
|
|
%files -n python%{python3_pkgversion}-mock
|
|
|
|
%license LICENSE.txt
|
|
|
|
%license LICENSE.txt
|
|
|
|
%doc docs/*
|
|
|
|
%doc docs/*
|
|
|
@ -74,12 +108,23 @@ sed -i "s|VERSIONPLACEHOLDER|%{version}|" setup.cfg mock/mock.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
|
%changelog
|
|
|
|
* Wed Jul 11 2018 Petr Viktorin <pviktori@redhat.com> - 2.0.0-11
|
|
|
|
* Wed Apr 03 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 2.0.0-13
|
|
|
|
- Remove the Python 2 subpackage
|
|
|
|
- Rebuilt for MSVSphere 8.10 beta
|
|
|
|
https://bugzilla.redhat.com/show_bug.cgi?id=1590793
|
|
|
|
|
|
|
|
- Re-enable tests
|
|
|
|
* Thu Apr 25 2019 Tomas Orsava <torsava@redhat.com> - 2.0.0-13
|
|
|
|
|
|
|
|
- Bumping due to problems with modular RPM upgrade path
|
|
|
|
|
|
|
|
- Resolves: rhbz#1695587
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Tue Jul 31 2018 Lumír Balhar <lbalhar@redhat.com> - 2.0.0-12
|
|
|
|
|
|
|
|
- Switch python3 coditions to bcond
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Sun Jul 15 2018 Lumír Balhar <lbalhar@redhat.com> - 2.0.0-11
|
|
|
|
|
|
|
|
- Enable Python 3 subpackage and disabled tests
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Fri Jul 13 2018 Lumír Balhar <lbalhar@redhat.com> - 2.0.0-10
|
|
|
|
|
|
|
|
- First version for python27 module
|
|
|
|
|
|
|
|
|
|
|
|
* Mon Jul 09 2018 Petr Viktorin <pviktori@redhat.com> - 2.0.0-10
|
|
|
|
* Mon Jul 09 2018 Petr Viktorin <pviktori@redhat.com> - 2.0.0-9
|
|
|
|
- Drop dependency on python3-funcsigs
|
|
|
|
- Drop dependency on python3-funcsigs
|
|
|
|
(funcsigs functionality is in the Python 3 standard library -- inspect)
|
|
|
|
(funcsigs functionality is in the Python 3 standard library -- inspect)
|
|
|
|
- Drop dependency on python2-unittest2
|
|
|
|
- Drop dependency on python2-unittest2
|
|
|
|