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