]> git.pld-linux.org Git - packages/python-mock.git/blob - python-mock.spec
- python 3.4
[packages/python-mock.git] / python-mock.spec
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
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
9 Name:           python-%{module}
10 Version:        1.0.1
11 Release:        3
12 License:        BSD-like
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/
17 %if %{with python2}
18 BuildRequires:  python-devel >= 2.4
19 BuildRequires:  python-distribute
20 %endif
21 %if %{with python3}
22 BuildRequires:  python3-devel
23 BuildRequires:  python3-distribute
24 %endif
25 BuildRequires:  rpm-pythonprov
26 BuildRequires:  rpmbuild(macros) >= 1.228
27 BuildArch:      noarch
28 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30 %description
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.
34
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.
40
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.
43
44 The mock module also provides utility functions/objects to assist with
45 testing, particularly monkey patching.
46
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.
51
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.
57
58 mock jest testowany z Pythonem w wersjach 2.4-2.7 oraz 3, a także z
59 najnowszymi wersjami Jythona i pypy.
60
61 Moduł mock udostępnia także funkcje/obiekty narzędziowe pomagające
62 przy testowaniu, w szczególności łataniu.
63
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
68
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.
73
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.
79
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.
82
83 The mock module also provides utility functions/objects to assist with
84 testing, particularly monkey patching.
85
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.
90
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.
96
97 mock jest testowany z Pythonem w wersjach 2.4-2.7 oraz 3, a także z
98 najnowszymi wersjami Jythona i pypy.
99
100 Moduł mock udostępnia także funkcje/obiekty narzędziowe pomagające
101 przy 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
117 rm -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
138 rm -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.126998 seconds and 4 git commands to generate.