diff --git a/python-jmespath.spec b/python-jmespath.spec index f8fc688..83f6c36 100644 --- a/python-jmespath.spec +++ b/python-jmespath.spec @@ -26,7 +26,15 @@ Summary: JSON Matching Expressions %{?python_provide:%python_provide python2-%{pypi_name}} BuildRequires: python2-devel +BuildRequires: python2-mock +BuildRequires: python-nose BuildRequires: python-setuptools +%if 0%{?rhel} && 0%{?rhel} < 7 +BuildRequires: python-ordereddict +# tests specifically import simplejson as json if python version is 2.6 +BuildRequires: python-simplejson +BuildRequires: python-unittest2 +%endif # rhel < 7 %description -n python2-%{pypi_name} JMESPath allows you to declaratively specify how to extract elements from @@ -38,6 +46,8 @@ Summary: JSON Matching Expressions %{?python_provide:%python_provide python3-%{pypi_name}} BuildRequires: python3-devel +BuildRequires: python3-mock +BuildRequires: python3-nose BuildRequires: python3-setuptools %description -n python3-%{pypi_name} @@ -51,7 +61,7 @@ rm -rf %{pypi_name}.egg-info %build %py2_build -%if %{?with python3} +%if %{with python3} %py3_build %endif # with python3 @@ -67,9 +77,13 @@ mv %{buildroot}/%{_bindir}/jp.py %{buildroot}/%{_bindir}/jp.py-%{python2_version ln -sf %{_bindir}/jp.py-%{python2_version} %{buildroot}/%{_bindir}/jp.py-2 ln -sf %{_bindir}/jp.py-%{python2_version} %{buildroot}/%{_bindir}/jp.py +%check +nosetests +%if %{with python3} +nosetests-%{python3_version} +%endif # with python3 %files -n python2-%{pypi_name} -%{!?_licensedir:%global license %doc} %doc README.rst %license LICENSE.txt %{_bindir}/jp.py