]> git.pld-linux.org Git - packages/python-mock.git/blame - python-mock.spec
cleanup BR
[packages/python-mock.git] / python-mock.spec
CommitLineData
8458ad63 1#
a9c81cc9 2# Conditional build:
8458ad63 3%bcond_without doc # don't build doc
a9c81cc9
JK
4%bcond_without python2 # CPython 2.x module
5%bcond_without python3 # CPython 3.x module
6
deb91033 7%define module mock
abd23d0c 8Summary: A Python Mocking and Patching Library for Testing
8bab2895 9Summary(pl.UTF-8): Biblioteka Pythona do testów przy użyciu techniki "mock" i łatania
abd23d0c 10Name: python-%{module}
deb91033 11Version: 1.0.1
8458ad63 12Release: 4
abd23d0c 13License: BSD-like
14Group: Development/Languages/Python
8bab2895 15Source0: http://pypi.python.org/packages/source/m/mock/%{module}-%{version}.tar.gz
deb91033 16# Source0-md5: c3971991738caa55ec7c356bbc154ee2
abd23d0c 17URL: http://python-mock.sourceforge.net/
2ce3f042
ER
18BuildRequires: rpm-pythonprov
19BuildRequires: rpmbuild(macros) >= 1.228
a9c81cc9 20%if %{with python2}
2ce3f042
ER
21BuildRequires: python-modules
22BuildRequires: python-setuptools
a9c81cc9
JK
23%endif
24%if %{with python3}
2ce3f042
ER
25BuildRequires: python3-modules
26BuildRequires: python3-setuptools
a9c81cc9 27%endif
abd23d0c 28BuildArch: noarch
29BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31%description
8bab2895
JB
32mock is a library for testing in Python. It allows you to replace
33parts of your system under test with mock objects and make assertions
34about how they have been used.
abd23d0c 35
8bab2895
JB
36mock provides a core `MagicMock` class removing the need to create a
37host of stubs throughout your test suite. After performing an action,
38you can make assertions about which methods/attributes were used and
39arguments they were called with. You can also specify return values
40and set needed attributes in the normal way.
abd23d0c 41
8bab2895
JB
42mock is tested on Python versions 2.4-2.7 and Python 3. mock is also
43tested with the latest versions of Jython and pypy.
44
45The mock module also provides utility functions/objects to assist with
abd23d0c 46testing, particularly monkey patching.
47
8bab2895
JB
48%description -l pl.UTF-8
49mock to biblioteka do testowania w Pythonie. Pozwala na zastępowanie
50części testowanego systemu obiektami "mock" oraz sprawdzania zapewnień
51(assert) o tym, jak zostały użyte.
52
53mock udostępnia klasę główną "MagicMock", dzięki której nie trzeba
54tworzyć systemu zaślepek do testów. W czasie wykonywania akcji można
55kontrolować, czy odpowiednie metody/atrybuty zostały użyte i z jakimi
56argumentami. Można określić zwracane wartości i w zwykły sposób
57ustawiać potrzebne atrybuty.
58
59mock jest testowany z Pythonem w wersjach 2.4-2.7 oraz 3, a także z
60najnowszymi wersjami Jythona i pypy.
61
62Moduł mock udostępnia także funkcje/obiekty narzędziowe pomagające
63przy testowaniu, w szczególności łataniu.
64
a9c81cc9
JK
65%package -n python3-%{module}
66Summary: A Python Mocking and Patching Library for Testing
67Summary(pl.UTF-8): Biblioteka Pythona do testów przy użyciu techniki "mock" i łatania
68Group: Development/Languages/Python
69
70%description -n python3-%{module}
71mock is a library for testing in Python. It allows you to replace
72parts of your system under test with mock objects and make assertions
73about how they have been used.
74
75mock provides a core `MagicMock` class removing the need to create a
76host of stubs throughout your test suite. After performing an action,
77you can make assertions about which methods/attributes were used and
78arguments they were called with. You can also specify return values
79and set needed attributes in the normal way.
80
81mock is tested on Python versions 2.4-2.7 and Python 3. mock is also
82tested with the latest versions of Jython and pypy.
83
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
98mock jest testowany z Pythonem w wersjach 2.4-2.7 oraz 3, a także z
99najnowszymi wersjami Jythona i pypy.
100
101Moduł mock udostępnia także funkcje/obiekty narzędziowe pomagające
102przy testowaniu, w szczególności łataniu.
103
8458ad63
ER
104%package apidocs
105Summary: %{module} API documentation
106Summary(pl.UTF-8): Dokumentacja API %{module}
107Group: Documentation
108
109%description apidocs
110API documentation for %{module}.
111
112%description apidocs -l pl.UTF-8
113Dokumentacja API %{module}.
a9c81cc9 114
abd23d0c 115%prep
116%setup -q -n %{module}-%{version}
117
118%build
a9c81cc9
JK
119%if %{with python2}
120%{__python} setup.py build --build-base build-2
121%endif
122
123%if %{with python3}
124%{__python3} setup.py build --build-base build-3
125%endif
abd23d0c 126
127%install
128rm -rf $RPM_BUILD_ROOT
a9c81cc9
JK
129
130%if %{with python2}
131%{__python} setup.py \
132 build --build-base build-2 \
133 install --skip-build \
abd23d0c 134 --optimize=2 \
135 --root=$RPM_BUILD_ROOT
136
137%py_postclean
a9c81cc9
JK
138%endif
139
140%if %{with python3}
141%{__python3} setup.py \
142 build --build-base build-3 \
143 install --skip-build \
144 --optimize=2 \
145 --root=$RPM_BUILD_ROOT
146%endif
abd23d0c 147
148%clean
149rm -rf $RPM_BUILD_ROOT
150
a9c81cc9 151%if %{with python2}
abd23d0c 152%files
153%defattr(644,root,root,755)
8458ad63 154%doc LICENSE.txt README.txt
8bab2895 155%{py_sitescriptdir}/mock.py[co]
8bab2895 156%{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
abd23d0c 157%endif
a9c81cc9
JK
158
159%if %{with python3}
160%files -n python3-%{module}
161%defattr(644,root,root,755)
8458ad63 162%doc LICENSE.txt README.txt
a9c81cc9
JK
163%{py3_sitescriptdir}/mock.py
164%{py3_sitescriptdir}/__pycache__/mock.*
165%{py3_sitescriptdir}/%{module}-*.egg-info
166%endif
8458ad63
ER
167
168%if %{with doc}
169%files apidocs
170%defattr(644,root,root,755)
171%doc html/*
172%endif
This page took 0.078194 seconds and 4 git commands to generate.