From 5cf478713c3a3e4c3f5218fa735421d7001e213e9f6e568553abe9af7b88feee Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Thu, 27 May 2021 10:01:10 +0000 Subject: [PATCH] better tests OBS-URL: https://build.opensuse.org/package/show/devel:tools/b4?expand=0&rev=44 --- b4.spec | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/b4.spec b/b4.spec index 608fbe7..f4debae 100644 --- a/b4.spec +++ b/b4.spec @@ -26,9 +26,13 @@ Group: Development/Tools/Other URL: https://git.kernel.org/pub/scm/utils/b4/b4.git Source0: %{name}-%{version}.tar.xz BuildArch: noarch -# for checks +# SECTION test requirements BuildRequires: git-core +BuildRequires: python3-dkimpy +BuildRequires: python3-dnspython +BuildRequires: python3-patatt BuildRequires: python3-requests +# /SECTION BuildRequires: python3-setuptools Requires: python3-dkimpy >= 1.0.5 Requires: python3-dnspython >= 2.0.0 @@ -47,6 +51,9 @@ precursor to Lore and Data in the Star Trek universe. %prep %autosetup -p1 +# use the system one +rm -rf patatt + # ditch shebang from .py files, they are non-executables anyway sed -i.old '1{/#!.*/d}' b4/*.py @@ -60,11 +67,11 @@ mv %{buildroot}/%{_mandir}/man5 %{buildroot}/%{_mandir}/man.5 %check python3 setup.py check export PYTHONPATH="./" -THEIRS=`python3 ./b4/command.py --version` +THEIRS=`%{buildroot}/%{_bindir}/b4 --version` OURS=`sed -n "s/__VERSION__ = '\(.*\)'/\1/p" b4/__init__.py` test "$THEIRS" = "$OURS" -python3 ./b4/command.py --help |grep -q 'mbox,am,attest' -python3 ./b4/command.py mbox abc |& grep -q 'Looking up https://lore.kernel.org/r/abc' +%{buildroot}/%{_bindir}/b4 --help |grep -q 'mbox,am,attest' +%{buildroot}/%{_bindir}/b4 mbox abc |& grep -q 'Looking up https://lore.kernel.org/r/abc' %files %doc README.rst