tests: fix discovery of location
backport upstream commit d93e1563add8c40450556b7d74520439ee792bd9
This commit is contained in:
parent
35d5f6a551
commit
33606eba22
27
0001-test-fix-discovery-of-location.patch
Normal file
27
0001-test-fix-discovery-of-location.patch
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
From d93e1563add8c40450556b7d74520439ee792bd9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pino Toscano <ptoscano@redhat.com>
|
||||||
|
Date: Fri, 12 Oct 2018 12:50:18 +0200
|
||||||
|
Subject: [PATCH] test: fix discovery of location
|
||||||
|
|
||||||
|
Use __file__ to detect the location of the script instead of sys.argv,
|
||||||
|
so it will work also when loaded as module.
|
||||||
|
---
|
||||||
|
test/test_augeas.py | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/test/test_augeas.py b/test/test_augeas.py
|
||||||
|
index 10edbe6..7474841 100644
|
||||||
|
--- a/test/test_augeas.py
|
||||||
|
+++ b/test/test_augeas.py
|
||||||
|
@@ -4,7 +4,7 @@ import unittest
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
|
-__mydir = os.path.dirname(sys.argv[0])
|
||||||
|
+__mydir = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
if not os.path.isdir(__mydir):
|
||||||
|
__mydir = os.getcwd()
|
||||||
|
|
||||||
|
--
|
||||||
|
2.21.0
|
||||||
|
|
@ -1,10 +1,11 @@
|
|||||||
Name: python-augeas
|
Name: python-augeas
|
||||||
Version: 0.5.0
|
Version: 0.5.0
|
||||||
Release: 19%{?dist}
|
Release: 20%{?dist}
|
||||||
Summary: Python bindings to augeas
|
Summary: Python bindings to augeas
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
URL: http://augeas.net/
|
URL: http://augeas.net/
|
||||||
Source0: http://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.gz
|
Source0: http://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.gz
|
||||||
|
Patch1: 0001-test-fix-discovery-of-location.patch
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
BuildRequires: python3-setuptools
|
BuildRequires: python3-setuptools
|
||||||
@ -25,6 +26,7 @@ python3-augeas is a set of Python bindings around augeas.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
|
%patch1 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%{py3_build}
|
%{py3_build}
|
||||||
@ -41,6 +43,10 @@ python3-augeas is a set of Python bindings around augeas.
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Apr 02 2020 Pino Toscano <ptoscano@redhat.com> - 0.5.0-20
|
||||||
|
- Backport upstream commit d93e1563add8c40450556b7d74520439ee792bd9 to fix
|
||||||
|
the discovery of location in the test
|
||||||
|
|
||||||
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-19
|
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-19
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user