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