]> git.pld-linux.org Git - packages/python-mock.git/blame - python-mock.spec
automatic change: use py_build/py_install macros
[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
56c80d13 12Release: 5
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 119%if %{with python2}
ec928db2 120%py_build
a9c81cc9
JK
121%endif
122
123%if %{with python3}
ec928db2 124%py3_build
a9c81cc9 125%endif
abd23d0c 126
127%install
128rm -rf $RPM_BUILD_ROOT
a9c81cc9
JK
129
130%if %{with python2}
ec928db2 131%py_install
abd23d0c 132
133%py_postclean
a9c81cc9
JK
134%endif
135
136%if %{with python3}
ec928db2 137%py3_install
a9c81cc9 138%endif
abd23d0c 139
140%clean
141rm -rf $RPM_BUILD_ROOT
142
a9c81cc9 143%if %{with python2}
abd23d0c 144%files
145%defattr(644,root,root,755)
8458ad63 146%doc LICENSE.txt README.txt
8bab2895 147%{py_sitescriptdir}/mock.py[co]
8bab2895 148%{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
abd23d0c 149%endif
a9c81cc9
JK
150
151%if %{with python3}
152%files -n python3-%{module}
153%defattr(644,root,root,755)
8458ad63 154%doc LICENSE.txt README.txt
a9c81cc9
JK
155%{py3_sitescriptdir}/mock.py
156%{py3_sitescriptdir}/__pycache__/mock.*
157%{py3_sitescriptdir}/%{module}-*.egg-info
158%endif
8458ad63
ER
159
160%if %{with doc}
161%files apidocs
162%defattr(644,root,root,755)
163%doc html/*
164%endif
This page took 0.084269 seconds and 4 git commands to generate.