summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-10-06 11:41:57 -0300
committerRenato Filho <renato.filho@openbossa.org>2011-10-06 15:43:32 -0300
commit1a3c2cf1b8285416b2f0f3f674c4ec10dc9e70ba (patch)
tree7a47ac5ecef9b90763e9bcda237949fe56560d59
parent6cda8a543d44425c18e8eca3ddbffaf7704eb61d (diff)
downloadpyside-1a3c2cf1b8285416b2f0f3f674c4ec10dc9e70ba.tar.gz
pyside-1a3c2cf1b8285416b2f0f3f674c4ec10dc9e70ba.tar.xz
pyside-1a3c2cf1b8285416b2f0f3f674c4ec10dc9e70ba.zip
Updated QtWebKit modue to works with python 2.x and 3.x
-rw-r--r--tests/QtWebKit/bug_959.py20
-rw-r--r--tests/QtWebKit/webview_test.py6
2 files changed, 12 insertions, 14 deletions
diff --git a/tests/QtWebKit/bug_959.py b/tests/QtWebKit/bug_959.py
index c4e53c7..3f40c9a 100644
--- a/tests/QtWebKit/bug_959.py
+++ b/tests/QtWebKit/bug_959.py
@@ -1,40 +1,40 @@
from PySide.QtCore import QObject, Slot, QTimer
-from PySide.QtWebKit import QWebView, QWebPage
+from PySide.QtWebKit import QWebView
import unittest
from helper import UsesQApplication
class JSFuncs(QObject):
functionID = -1
- @Slot(unicode,result=unicode)
+ @Slot(str,result=str)
def slot_str_str(self, x):
JSFuncs.functionID = 0
return x.upper()
- @Slot(unicode,result='QVariant')
+ @Slot(str,result='QVariant')
def slot_str_list(self, x):
JSFuncs.functionID = 1
return [x, x]
- @Slot('QStringList',result=unicode)
+ @Slot('QStringList',result=str)
def slot_strlist_str(self, x):
JSFuncs.functionID = 2
return x[-1]
- @Slot('QVariant',result=unicode)
+ @Slot('QVariant',result=str)
def slot_variant_str(self, x):
JSFuncs.functionID = 3
- return unicode(x)
+ return str(x)
- @Slot('QVariantList',result=unicode)
+ @Slot('QVariantList',result=str)
def slot_variantlist_str(self, x):
JSFuncs.functionID = 4
- return unicode(x[-1])
+ return str(x[-1])
- @Slot('QVariantMap',result=unicode)
+ @Slot('QVariantMap',result=str)
def slot_variantmap_str(self, x):
JSFuncs.functionID = 5
- return unicode(x["foo"])
+ return str(x["foo"])
diff --git a/tests/QtWebKit/webview_test.py b/tests/QtWebKit/webview_test.py
index ab81a30..591d072 100644
--- a/tests/QtWebKit/webview_test.py
+++ b/tests/QtWebKit/webview_test.py
@@ -2,10 +2,11 @@
'''Test cases for QWebView'''
import unittest
+import py3kcompat as py3k
import sys
from PySide.QtCore import QObject, SIGNAL, QUrl
-from PySide.QtWebKit import *
+from PySide.QtWebKit import QWebPage, QWebView
from PySide.QtNetwork import QNetworkRequest
from helper import adjust_filename, TimedQApplication
@@ -62,8 +63,5 @@ class TestLoadFinished(TimedQApplication):
if ok:
self.called = True
- def testNamedArgumentTypeChecking(self):
- self.assertRaises(TypeError, self.view.load, QNetworkRequest(), body=unicode('foo'))
-
if __name__ == '__main__':
unittest.main()