From 538492820169d1c6aab9c3673531951e8f54755ccbb7cd247ffc6accc84a192d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 7 Oct 2019 08:24:22 +0000 Subject: [PATCH] - Update tests and dependencies to make the package work OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-junos-eznc?expand=0&rev=2 --- python-junos-eznc.changes | 5 +++++ python-junos-eznc.spec | 46 +++++++++++++++++++-------------------- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/python-junos-eznc.changes b/python-junos-eznc.changes index 6e4449b..42c0d22 100644 --- a/python-junos-eznc.changes +++ b/python-junos-eznc.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Oct 7 08:24:05 UTC 2019 - Tomáš Chvátal + +- Update tests and dependencies to make the package work + ------------------------------------------------------------------- Sun Sep 29 18:50:20 UTC 2019 - Martin Hauke diff --git a/python-junos-eznc.spec b/python-junos-eznc.spec index 86a0a6c..bc87fb4 100644 --- a/python-junos-eznc.spec +++ b/python-junos-eznc.spec @@ -18,46 +18,43 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} -%bcond_without test Name: python-junos-eznc Version: 2.3.0 Release: 0 Summary: Junos 'EZ' automation for non-programmers License: Apache-2.0 -Group: Development/Languages/Python URL: https://www.github.com/Juniper/py-junos-eznc Source: https://github.com/Juniper/py-junos-eznc/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz +BuildRequires: %{python_module Jinja2 >= 2.7.1} +BuildRequires: %{python_module PyYAML >= 5.1} +BuildRequires: %{python_module lxml >= 3.2.4} +BuildRequires: %{python_module mock} +BuildRequires: %{python_module ncclient >= 0.6.3} +BuildRequires: %{python_module netaddr} +BuildRequires: %{python_module nose} +BuildRequires: %{python_module paramiko >= 1.15.2} +BuildRequires: %{python_module pyparsing} +BuildRequires: %{python_module pyserial} +BuildRequires: %{python_module scp >= 0.7.0} +BuildRequires: %{python_module selectors2} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module six} +BuildRequires: %{python_module transitions} +BuildRequires: %{python_module unittest2 >= 0.5.1} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-Jinja2 >= 2.7.1 -Requires: python-PyYAML >= 3.10 +Requires: python-PyYAML >= 5.1 Requires: python-lxml >= 3.2.4 -Requires: python-ncclient >= 0.5.3 +Requires: python-ncclient >= 0.6.3 Requires: python-netaddr Requires: python-paramiko >= 1.15.2 +Requires: python-pyparsing Requires: python-pyserial Requires: python-scp >= 0.7.0 Requires: python-six Requires: python-transitions BuildArch: noarch -%if %{with test} -BuildRequires: %{python_module Jinja2 >= 2.7.1} -BuildRequires: %{python_module PyYAML >= 3.10} -BuildRequires: %{python_module lxml >= 3.2.4} -BuildRequires: %{python_module mock} -BuildRequires: %{python_module ncclient >= 0.5.3} -BuildRequires: %{python_module netaddr} -BuildRequires: %{python_module nose} -BuildRequires: %{python_module paramiko >= 1.15.2} -BuildRequires: %{python_module pyserial} -BuildRequires: %{python_module pytest} -BuildRequires: %{python_module scp >= 0.7.0} -BuildRequires: %{python_module six} -BuildRequires: %{python_module unittest2} -BuildRequires: %{python_module transitions} -BuildRequires: %{python_module selectors2} -%endif %python_subpackages %description @@ -75,6 +72,9 @@ These capabilities include, but are not limited to: %prep %setup -q -n py-junos-eznc-%{version} +sed -i -e '/yamlordereddictloader/d' requirements.txt +# requires deprecated and not working yamlordereddictloader +rm tests/unit/factory/test_cmdtable.py %build %python_build @@ -84,9 +84,7 @@ These capabilities include, but are not limited to: %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -# FIXME: Unit tests can't import "jnpr.junos" during build-time -#%%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} py.test-%{$python_version} tests/unit -#%%pytest tests/unit +%python_expand PYTHONPATH=lib/ nosetests-%{$python_bin_suffix} -v tests/unit %files %{python_files} %license COPYRIGHT LICENSE