File python-testinfra.spec of Package python-testinfra.openSUSE_Backports_SLE-12

#
# spec file for package python-testinfra
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-testinfra
Version:        1.6.5
Release:        0
Summary:        Test infrastructures
License:        Apache-2.0
Group:          Development/Languages/Python
Url:            http://github.com/philpep/testinfra
Source:         https://files.pythonhosted.org/packages/source/t/testinfra/testinfra-%{version}.tar.gz
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module pbr}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
Requires(post):   update-alternatives
Requires(postun): update-alternatives
Requires:       python-pytest
Requires:       python-six >= 1.4
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%python_subpackages

%description
With Testinfra you can write unit tests in Python to test actual state of
your servers configured by managements tools like Salt, Ansible, Puppet,
Chef and so on.

Testinfra aims to be a Serverspec equivalent in python and is written as
a plugin to the Pytest test engine

%prep
%setup -q -n testinfra-%{version}

%build
%python_build

%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/testinfra
%python_expand %fdupes %{buildroot}%{$python_sitelib}/testinfra

%post
%python_install_alternative testinfra

%postun
%python_uninstall_alternative testinfra

%files %{python_files}
%defattr(-,root,root,-)
%doc CHANGELOG.rst LICENSE README.rst
%python_alternative %{_bindir}/testinfra
%{python_sitelib}/*

%changelog