3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
7 Summary: A Python Mocking and Patching Library for Testing
8 Summary(pl.UTF-8): Biblioteka Pythona do testów przy użyciu techniki "mock" i łatania
13 Group: Development/Languages/Python
14 Source0: http://pypi.python.org/packages/source/m/mock/%{module}-%{version}.tar.gz
15 # Source0-md5: c3971991738caa55ec7c356bbc154ee2
16 URL: http://python-mock.sourceforge.net/
18 BuildRequires: python-devel >= 2.4
19 BuildRequires: python-distribute
22 BuildRequires: python3-devel
23 BuildRequires: python3-distribute
25 BuildRequires: rpm-pythonprov
26 BuildRequires: rpmbuild(macros) >= 1.228
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 mock is a library for testing in Python. It allows you to replace
32 parts of your system under test with mock objects and make assertions
33 about how they have been used.
35 mock provides a core `MagicMock` class removing the need to create a
36 host of stubs throughout your test suite. After performing an action,
37 you can make assertions about which methods/attributes were used and
38 arguments they were called with. You can also specify return values
39 and set needed attributes in the normal way.
41 mock is tested on Python versions 2.4-2.7 and Python 3. mock is also
42 tested with the latest versions of Jython and pypy.
44 The mock module also provides utility functions/objects to assist with
45 testing, particularly monkey patching.
47 %description -l pl.UTF-8
48 mock to biblioteka do testowania w Pythonie. Pozwala na zastępowanie
49 części testowanego systemu obiektami "mock" oraz sprawdzania zapewnień
50 (assert) o tym, jak zostały użyte.
52 mock udostępnia klasę główną "MagicMock", dzięki której nie trzeba
53 tworzyć systemu zaślepek do testów. W czasie wykonywania akcji można
54 kontrolować, czy odpowiednie metody/atrybuty zostały użyte i z jakimi
55 argumentami. Można określić zwracane wartości i w zwykły sposób
56 ustawiać potrzebne atrybuty.
58 mock jest testowany z Pythonem w wersjach 2.4-2.7 oraz 3, a także z
59 najnowszymi wersjami Jythona i pypy.
61 Moduł mock udostępnia także funkcje/obiekty narzędziowe pomagające
62 przy testowaniu, w szczególności łataniu.
64 %package -n python3-%{module}
65 Summary: A Python Mocking and Patching Library for Testing
66 Summary(pl.UTF-8): Biblioteka Pythona do testów przy użyciu techniki "mock" i łatania
67 Group: Development/Languages/Python
69 %description -n python3-%{module}
70 mock is a library for testing in Python. It allows you to replace
71 parts of your system under test with mock objects and make assertions
72 about how they have been used.
74 mock provides a core `MagicMock` class removing the need to create a
75 host of stubs throughout your test suite. After performing an action,
76 you can make assertions about which methods/attributes were used and
77 arguments they were called with. You can also specify return values
78 and set needed attributes in the normal way.
80 mock is tested on Python versions 2.4-2.7 and Python 3. mock is also
81 tested with the latest versions of Jython and pypy.
83 The mock module also provides utility functions/objects to assist with
84 testing, particularly monkey patching.
86 %description -n python3-%{module} -l pl.UTF-8
87 mock to biblioteka do testowania w Pythonie. Pozwala na zastępowanie
88 części testowanego systemu obiektami "mock" oraz sprawdzania zapewnień
89 (assert) o tym, jak zostały użyte.
91 mock udostępnia klasę główną "MagicMock", dzięki której nie trzeba
92 tworzyć systemu zaślepek do testów. W czasie wykonywania akcji można
93 kontrolować, czy odpowiednie metody/atrybuty zostały użyte i z jakimi
94 argumentami. Można określić zwracane wartości i w zwykły sposób
95 ustawiać potrzebne atrybuty.
97 mock jest testowany z Pythonem w wersjach 2.4-2.7 oraz 3, a także z
98 najnowszymi wersjami Jythona i pypy.
100 Moduł mock udostępnia także funkcje/obiekty narzędziowe pomagające
101 przy testowaniu, w szczególności łataniu.
105 %setup -q -n %{module}-%{version}
109 %{__python} setup.py build --build-base build-2
113 %{__python3} setup.py build --build-base build-3
117 rm -rf $RPM_BUILD_ROOT
120 %{__python} setup.py \
121 build --build-base build-2 \
122 install --skip-build \
124 --root=$RPM_BUILD_ROOT
130 %{__python3} setup.py \
131 build --build-base build-3 \
132 install --skip-build \
134 --root=$RPM_BUILD_ROOT
138 rm -rf $RPM_BUILD_ROOT
142 %defattr(644,root,root,755)
143 %doc LICENSE.txt README.txt html
144 %{py_sitescriptdir}/mock.py[co]
145 %if "%{py_ver}" > "2.4"
146 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
151 %files -n python3-%{module}
152 %defattr(644,root,root,755)
153 %doc LICENSE.txt README.txt html
154 %{py3_sitescriptdir}/mock.py
155 %{py3_sitescriptdir}/__pycache__/mock.*
156 %{py3_sitescriptdir}/%{module}-*.egg-info