]> git.pld-linux.org Git - packages/python-mock.git/blame_incremental - python-mock.spec
- python 3.4
[packages/python-mock.git] / python-mock.spec
... / ...
CommitLineData
1
2# Conditional build:
3%bcond_without python2 # CPython 2.x module
4%bcond_without python3 # CPython 3.x module
5
6%define module mock
7Summary: A Python Mocking and Patching Library for Testing
8Summary(pl.UTF-8): Biblioteka Pythona do testów przy użyciu techniki "mock" i łatania
9Name: python-%{module}
10Version: 1.0.1
11Release: 3
12License: BSD-like
13Group: Development/Languages/Python
14Source0: http://pypi.python.org/packages/source/m/mock/%{module}-%{version}.tar.gz
15# Source0-md5: c3971991738caa55ec7c356bbc154ee2
16URL: http://python-mock.sourceforge.net/
17%if %{with python2}
18BuildRequires: python-devel >= 2.4
19BuildRequires: python-distribute
20%endif
21%if %{with python3}
22BuildRequires: python3-devel
23BuildRequires: python3-distribute
24%endif
25BuildRequires: rpm-pythonprov
26BuildRequires: rpmbuild(macros) >= 1.228
27BuildArch: noarch
28BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30%description
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.
34
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.
40
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
45testing, particularly monkey patching.
46
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
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
104%prep
105%setup -q -n %{module}-%{version}
106
107%build
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
115
116%install
117rm -rf $RPM_BUILD_ROOT
118
119%if %{with python2}
120%{__python} setup.py \
121 build --build-base build-2 \
122 install --skip-build \
123 --optimize=2 \
124 --root=$RPM_BUILD_ROOT
125
126%py_postclean
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
136
137%clean
138rm -rf $RPM_BUILD_ROOT
139
140%if %{with python2}
141%files
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
147%endif
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.056625 seconds and 4 git commands to generate.