libreport/0034-testsuite-work-around-the-issue-with-report-python.patch
Jakub Filak df5243869d Pre-release update
Resolves: #1133549
2014-09-03 17:19:21 +02:00

60 lines
1.9 KiB
Diff

From 084de59a8ed21e9feb50b49ccbba6b472641c284 Mon Sep 17 00:00:00 2001
From: Jakub Filak <jfilak@redhat.com>
Date: Wed, 3 Sep 2014 13:38:46 +0200
Subject: [PATCH 34/34] testsuite: work around the issue with 'report-python'
Signed-off-by: Jakub Filak <jfilak@redhat.com>
---
src/report-python/__init__.py | 9 ++++++++-
tests/osinfo.at | 1 +
tests/report_python.at | 1 +
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/report-python/__init__.py b/src/report-python/__init__.py
index ce7ea06..71e2d62 100644
--- a/src/report-python/__init__.py
+++ b/src/report-python/__init__.py
@@ -17,7 +17,14 @@ try:
except ImportError:
from report._py3report import *
-from report.io import TextIO, GTKIO, NewtIO
+try:
+ from report.io import TextIO, GTKIO, NewtIO
+except ImportError:
+ # Support testing
+ _temp = __import__("io", globals(), locals(), ["TextIO", "GTKIO", "NewtIO"], -1)
+ TextIO = _temp.TextIO
+ GTKIO = _temp.GTKIO
+ NewtIO = _temp.NewtIO
#Compatibility with report package:
# Author(s): Gavin Romig-Koch <gavin@redhat.com>
diff --git a/tests/osinfo.at b/tests/osinfo.at
index b57452d..868a9a2 100644
--- a/tests/osinfo.at
+++ b/tests/osinfo.at
@@ -401,6 +401,7 @@ int main(void)
AT_PYTESTFUN([parse_osinfo_python],
[[import sys
+sys.path.insert(0, "../../../src/report-python")
sys.path.insert(0, "../../../src/report-python/.libs")
report = __import__("report-python", globals(), locals(), [], -1)
diff --git a/tests/report_python.at b/tests/report_python.at
index 17e4fb3..5569b1f 100644
--- a/tests/report_python.at
+++ b/tests/report_python.at
@@ -9,6 +9,7 @@ AT_BANNER([report_python])
AT_PYTESTFUN([get_from_etc_os_release],
[[import sys
+sys.path.insert(0, "../../../src/report-python")
sys.path.insert(0, "../../../src/report-python/.libs")
report = __import__("report-python", globals(), locals(), [], -1)
--
2.1.0