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

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