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

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