]> git.pld-linux.org Git - packages/python-mock.git/blame - python-mock.spec
- python 3.6
[packages/python-mock.git] / python-mock.spec
CommitLineData
8458ad63 1#
a9c81cc9 2# Conditional build:
0d282d8d 3%bcond_without doc # Sphinx documentation
a9c81cc9
JK
4%bcond_without python2 # CPython 2.x module
5%bcond_without python3 # CPython 3.x module
0d282d8d 6%bcond_with tests # test target
a9c81cc9 7
deb91033 8%define module mock
abd23d0c 9Summary: A Python Mocking and Patching Library for Testing
8bab2895 10Summary(pl.UTF-8): Biblioteka Pythona do testów przy użyciu techniki "mock" i łatania
abd23d0c 11Name: python-%{module}
0d282d8d 12Version: 1.3.0
3e5a3df1 13Release: 3
abd23d0c 14License: BSD-like
15Group: Development/Languages/Python
0d282d8d
JB
16#Source0Download: https://pypi.python.org/simple/mock/
17Source0: https://pypi.python.org/packages/source/m/mock/%{module}-%{version}.tar.gz
18# Source0-md5: 73ee8a4afb3ff4da1b4afa287f39fdeb
abd23d0c 19URL: http://python-mock.sourceforge.net/
2ce3f042 20BuildRequires: rpm-pythonprov
9830114b 21BuildRequires: rpmbuild(macros) >= 1.710
a9c81cc9 22%if %{with python2}
0d282d8d
JB
23BuildRequires: python-modules >= 1:2.6
24BuildRequires: python-pbr >= 1.3
25BuildRequires: python-setuptools >= 17.1
26BuildRequires: python-six >= 1.7
27%{?with_tests:BuildRequires: python-unittest2 >= 1.1.0}
a9c81cc9
JK
28%endif
29%if %{with python3}
0d282d8d
JB
30BuildRequires: python3-modules >= 1:3.2
31BuildRequires: python3-pbr >= 1.3
32BuildRequires: python3-setuptools >= 17.1
33BuildRequires: python3-six >= 1.7
34%{?with_tests:BuildRequires: python3-unittest2 >= 1.1.0}
a9c81cc9 35%endif
0d282d8d 36%{?with_doc:BuildRequires: sphinx-pdg}
abd23d0c 37BuildArch: noarch
38BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40%description
8bab2895
JB
41mock is a library for testing in Python. It allows you to replace
42parts of your system under test with mock objects and make assertions
43about how they have been used.
abd23d0c 44
8bab2895
JB
45mock provides a core `MagicMock` class removing the need to create a
46host of stubs throughout your test suite. After performing an action,
47you can make assertions about which methods/attributes were used and
48arguments they were called with. You can also specify return values
49and set needed attributes in the normal way.
abd23d0c 50
8bab2895 51The mock module also provides utility functions/objects to assist with
abd23d0c 52testing, particularly monkey patching.
53
8bab2895
JB
54%description -l pl.UTF-8
55mock to biblioteka do testowania w Pythonie. Pozwala na zastępowanie
56części testowanego systemu obiektami "mock" oraz sprawdzania zapewnień
57(assert) o tym, jak zostały użyte.
58
59mock udostępnia klasę główną "MagicMock", dzięki której nie trzeba
60tworzyć systemu zaślepek do testów. W czasie wykonywania akcji można
61kontrolować, czy odpowiednie metody/atrybuty zostały użyte i z jakimi
62argumentami. Można określić zwracane wartości i w zwykły sposób
63ustawiać potrzebne atrybuty.
64
8bab2895
JB
65Moduł mock udostępnia także funkcje/obiekty narzędziowe pomagające
66przy testowaniu, w szczególności łataniu.
67
a9c81cc9
JK
68%package -n python3-%{module}
69Summary: A Python Mocking and Patching Library for Testing
70Summary(pl.UTF-8): Biblioteka Pythona do testów przy użyciu techniki "mock" i łatania
71Group: Development/Languages/Python
72
73%description -n python3-%{module}
74mock is a library for testing in Python. It allows you to replace
75parts of your system under test with mock objects and make assertions
76about how they have been used.
77
78mock provides a core `MagicMock` class removing the need to create a
79host of stubs throughout your test suite. After performing an action,
80you can make assertions about which methods/attributes were used and
81arguments they were called with. You can also specify return values
82and set needed attributes in the normal way.
83
a9c81cc9
JK
84The mock module also provides utility functions/objects to assist with
85testing, particularly monkey patching.
86
87%description -n python3-%{module} -l pl.UTF-8
88mock to biblioteka do testowania w Pythonie. Pozwala na zastępowanie
89części testowanego systemu obiektami "mock" oraz sprawdzania zapewnień
90(assert) o tym, jak zostały użyte.
91
92mock udostępnia klasę główną "MagicMock", dzięki której nie trzeba
93tworzyć systemu zaślepek do testów. W czasie wykonywania akcji można
94kontrolować, czy odpowiednie metody/atrybuty zostały użyte i z jakimi
95argumentami. Można określić zwracane wartości i w zwykły sposób
96ustawiać potrzebne atrybuty.
97
a9c81cc9
JK
98Moduł mock udostępnia także funkcje/obiekty narzędziowe pomagające
99przy testowaniu, w szczególności łataniu.
100
8458ad63 101%package apidocs
0d282d8d
JB
102Summary: API documentation for mock module
103Summary(pl.UTF-8): Dokumentacja API modułu mock
8458ad63
ER
104Group: Documentation
105
106%description apidocs
0d282d8d 107API documentation for mock module.
8458ad63
ER
108
109%description apidocs -l pl.UTF-8
0d282d8d 110Dokumentacja API modułu mock.
a9c81cc9 111
abd23d0c 112%prep
113%setup -q -n %{module}-%{version}
114
0d282d8d
JB
115# avoid rewriting by pbr
116chmod a-w AUTHORS ChangeLog
117
abd23d0c 118%build
a9c81cc9 119%if %{with python2}
0d282d8d 120%py_build %{?with_tests:test}
a9c81cc9
JK
121%endif
122
123%if %{with python3}
0d282d8d
JB
124%py3_build %{?with_tests:test}
125%endif
126
127%if %{with doc}
128sphinx-build -b html docs html
129%{__rm} -r html/{_sources,.doctrees,.buildinfo}
a9c81cc9 130%endif
abd23d0c 131
132%install
133rm -rf $RPM_BUILD_ROOT
a9c81cc9
JK
134
135%if %{with python2}
ec928db2 136%py_install
abd23d0c 137
138%py_postclean
a9c81cc9
JK
139%endif
140
141%if %{with python3}
ec928db2 142%py3_install
0d282d8d
JB
143
144# pythonegg dependency generator resolves conditionals for requires() based on
145# python version that runs the generator, not the version egg is targeted;
146# avoid generation of python3egg(funcsigs) dependency for python >= 3.3
147%{__sed} -i -e '/^\[:(python_version<"3.3")]/,/^$/d' $RPM_BUILD_ROOT%{py3_sitescriptdir}/mock-%{version}-py*.egg-info/requires.txt
a9c81cc9 148%endif
abd23d0c 149
150%clean
151rm -rf $RPM_BUILD_ROOT
152
a9c81cc9 153%if %{with python2}
abd23d0c 154%files
155%defattr(644,root,root,755)
0d282d8d
JB
156%doc AUTHORS ChangeLog LICENSE.txt NEWS README.rst
157%{py_sitescriptdir}/mock
8bab2895 158%{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
abd23d0c 159%endif
a9c81cc9
JK
160
161%if %{with python3}
162%files -n python3-%{module}
163%defattr(644,root,root,755)
0d282d8d
JB
164%doc AUTHORS ChangeLog LICENSE.txt NEWS README.rst
165%{py3_sitescriptdir}/mock
166%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
a9c81cc9 167%endif
8458ad63
ER
168
169%if %{with doc}
170%files apidocs
171%defattr(644,root,root,755)
172%doc html/*
173%endif
This page took 0.088018 seconds and 4 git commands to generate.