]>
Commit | Line | Data |
---|---|---|
aa2fd2ec JB |
1 | # TODO: why tests fail with python 2.7? |
2 | # | |
3 | # Conditional build: | |
4 | %bcond_without tests # make check | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | Summary: Testscenarios - pyunit extension for dependency injection | |
9 | Summary(pl.UTF-8): Testscenarios - rozszerzenie pyunit do wstrzykiwania zależności | |
10 | Name: python-testscenarios | |
11 | Version: 0.5.0 | |
270fe9a0 | 12 | Release: 3 |
aa2fd2ec JB |
13 | License: Apache v2.0 or BSD |
14 | Group: Libraries/Python | |
15 | #Source0Download: https://pypi.python.org/simple/testscenarios/ | |
16 | Source0: https://pypi.python.org/packages/source/t/testscenarios/testscenarios-%{version}.tar.gz | |
17 | # Source0-md5: 859073d9e7b049aee2e6704c51f6001a | |
18 | URL: https://launchpad.net/testscenarios | |
19 | BuildRequires: rpm-pythonprov | |
20 | BuildRequires: rpmbuild(macros) >= 1.714 | |
21 | %if %{with python2} | |
22 | BuildRequires: python-modules >= 1:2.6 | |
23 | BuildRequires: python-pbr >= 0.11 | |
24 | BuildRequires: python-setuptools | |
25 | BuildRequires: python-testtools | |
26 | %endif | |
27 | %if %{with python3} | |
28 | BuildRequires: python3-modules >= 1:3.2 | |
29 | BuildRequires: python3-pbr >= 0.11 | |
30 | BuildRequires: python3-setuptools | |
31 | BuildRequires: python3-testtools | |
32 | %endif | |
33 | Requires: python-modules >= 1:2.6 | |
34 | Requires: python-pbr >= 0.11 | |
35 | Requires: python-testtools | |
36 | BuildArch: noarch | |
37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
38 | ||
39 | %description | |
40 | testscenarios provides clean dependency injection for python unittest | |
41 | style tests. This can be used for interface testing (testing many | |
42 | implementations via a single test suite) or for classic dependency | |
43 | injection (provide tests with dependencies externally to the test code | |
44 | itself, allowing easy testing in different situations). | |
45 | ||
46 | %description -l pl.UTF-8 | |
47 | Moduł testscenarios zapewnia czyste wstrzykiwanie zależności dla | |
48 | testów pythonowych w stylu unittest. Może to być używane do testowania | |
49 | interfejsów (testowania wielu implementacji poprzez prosty zestaw | |
50 | testów) albo klasycznego wstrzykiwania zależności (dostarczania testów | |
51 | z zależnościami zewnętrznymi w stosunku do kodu testującego, co | |
52 | pozwala na łatwiejsze testowanie w różnych sytuacjach). | |
53 | ||
54 | %package -n python3-testscenarios | |
55 | Summary: Testscenarios - pyunit extension for dependency injection | |
56 | Summary(pl.UTF-8): Testscenarios - rozszerzenie pyunit do wstrzykiwania zależności | |
57 | Group: Libraries/Python | |
58 | Requires: python3-modules >= 1:3.2 | |
59 | Requires: python3-pbr >= 0.11 | |
60 | Requires: python3-testtools | |
61 | ||
62 | %description -n python3-testscenarios | |
63 | testscenarios provides clean dependency injection for python unittest | |
64 | style tests. This can be used for interface testing (testing many | |
65 | implementations via a single test suite) or for classic dependency | |
66 | injection (provide tests with dependencies externally to the test code | |
67 | itself, allowing easy testing in different situations). | |
68 | ||
69 | %description -n python3-testscenarios -l pl.UTF-8 | |
70 | Moduł testscenarios zapewnia czyste wstrzykiwanie zależności dla | |
71 | testów pythonowych w stylu unittest. Może to być używane do testowania | |
72 | interfejsów (testowania wielu implementacji poprzez prosty zestaw | |
73 | testów) albo klasycznego wstrzykiwania zależności (dostarczania testów | |
74 | z zależnościami zewnętrznymi w stosunku do kodu testującego, co | |
75 | pozwala na łatwiejsze testowanie w różnych sytuacjach). | |
76 | ||
77 | %prep | |
78 | %setup -q -n testscenarios-%{version} | |
79 | ||
80 | %build | |
81 | %if %{with python2} | |
82 | %py_build | |
83 | ||
84 | # tests fail with python 2.x - too old unittest? | |
85 | #%{?with_tests:%{__make} check PYTHON=%{__python}} | |
86 | %endif | |
87 | ||
88 | %if %{with python3} | |
89 | %py3_build | |
90 | ||
91 | %{?with_tests:%{__make} check PYTHON=%{__python3}} | |
92 | %endif | |
93 | ||
94 | %install | |
95 | rm -rf $RPM_BUILD_ROOT | |
96 | ||
97 | %if %{with python2} | |
98 | %py_install | |
99 | ||
100 | %py_postclean | |
101 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/testscenarios/tests | |
102 | %endif | |
103 | ||
104 | %if %{with python3} | |
105 | %py3_install | |
106 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/testscenarios/tests | |
107 | %endif | |
108 | ||
109 | %clean | |
110 | rm -rf $RPM_BUILD_ROOT | |
111 | ||
112 | %if %{with python2} | |
113 | %files | |
114 | %defattr(644,root,root,755) | |
115 | %doc AUTHORS BSD COPYING ChangeLog GOALS NEWS README | |
116 | %{py_sitescriptdir}/testscenarios | |
117 | %{py_sitescriptdir}/testscenarios-%{version}-py*.egg-info | |
118 | %endif | |
119 | ||
120 | %if %{with python3} | |
121 | %files -n python3-testscenarios | |
122 | %defattr(644,root,root,755) | |
123 | %doc AUTHORS BSD COPYING ChangeLog GOALS NEWS README | |
124 | %{py3_sitescriptdir}/testscenarios | |
125 | %{py3_sitescriptdir}/testscenarios-%{version}-py*.egg-info | |
126 | %endif |