Blame SOURCES/0057-testsuite-work-around-the-issue-with-report-python.patch

4b6aa8
From 3fb19efcf2d64ab628c706c08f536f4cac72fb70 Mon Sep 17 00:00:00 2001
4b6aa8
From: Jakub Filak <jfilak@redhat.com>
4b6aa8
Date: Wed, 3 Sep 2014 13:38:46 +0200
4b6aa8
Subject: [LIBREPORT PATCH 57/93] testsuite: work around the issue with
4b6aa8
 'report-python'
4b6aa8
4b6aa8
Signed-off-by: Jakub Filak <jfilak@redhat.com>
4b6aa8
4b6aa8
Conflicts:
4b6aa8
	src/report-python/__init__.py
4b6aa8
---
4b6aa8
 src/report-python/__init__.py | 10 +++++++++-
4b6aa8
 tests/osinfo.at               |  1 +
4b6aa8
 tests/report_python.at        |  1 +
4b6aa8
 3 files changed, 11 insertions(+), 1 deletion(-)
4b6aa8
4b6aa8
diff --git a/src/report-python/__init__.py b/src/report-python/__init__.py
4b6aa8
index b434672..b0ba497 100644
4b6aa8
--- a/src/report-python/__init__.py
4b6aa8
+++ b/src/report-python/__init__.py
4b6aa8
@@ -13,7 +13,15 @@
4b6aa8
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
4b6aa8
 
4b6aa8
 from _pyreport import *
4b6aa8
-from report.io import TextIO, GTKIO, NewtIO
4b6aa8
+
4b6aa8
+try:
4b6aa8
+    from report.io import TextIO, GTKIO, NewtIO
4b6aa8
+except ImportError:
4b6aa8
+    # Support testing
4b6aa8
+    _temp = __import__("io", globals(), locals(), ["TextIO", "GTKIO", "NewtIO"], -1)
4b6aa8
+    TextIO = _temp.TextIO
4b6aa8
+    GTKIO = _temp.GTKIO
4b6aa8
+    NewtIO = _temp.NewtIO
4b6aa8
 
4b6aa8
 #Compatibility with report package:
4b6aa8
 # Author(s): Gavin Romig-Koch <gavin@redhat.com>
4b6aa8
diff --git a/tests/osinfo.at b/tests/osinfo.at
4b6aa8
index b57452d..868a9a2 100644
4b6aa8
--- a/tests/osinfo.at
4b6aa8
+++ b/tests/osinfo.at
4b6aa8
@@ -401,6 +401,7 @@ int main(void)
4b6aa8
 AT_PYTESTFUN([parse_osinfo_python],
4b6aa8
 [[import sys
4b6aa8
 
4b6aa8
+sys.path.insert(0, "../../../src/report-python")
4b6aa8
 sys.path.insert(0, "../../../src/report-python/.libs")
4b6aa8
 
4b6aa8
 report = __import__("report-python", globals(), locals(), [], -1)
4b6aa8
diff --git a/tests/report_python.at b/tests/report_python.at
4b6aa8
index 17e4fb3..5569b1f 100644
4b6aa8
--- a/tests/report_python.at
4b6aa8
+++ b/tests/report_python.at
4b6aa8
@@ -9,6 +9,7 @@ AT_BANNER([report_python])
4b6aa8
 AT_PYTESTFUN([get_from_etc_os_release],
4b6aa8
 [[import sys
4b6aa8
 
4b6aa8
+sys.path.insert(0, "../../../src/report-python")
4b6aa8
 sys.path.insert(0, "../../../src/report-python/.libs")
4b6aa8
 
4b6aa8
 report = __import__("report-python", globals(), locals(), [], -1)
4b6aa8
-- 
4b6aa8
1.8.3.1
4b6aa8