Fix bug 803 - "QWebElementCollection.operator[] is not implemented"

Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
          Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
Hugo Parente Lima 2011-05-17 19:55:05 -03:00
commit eb133c76b8
3 changed files with 35 additions and 1 deletions

View file

@ -1,5 +1,6 @@
PYSIDE_TEST(bug_448.py)
PYSIDE_TEST(bug_694.py)
PYSIDE_TEST(bug_803.py)
PYSIDE_TEST(webpage_test.py)
PYSIDE_TEST(webview_test.py)
PYSIDE_TEST(webframe_test.py)

18
tests/QtWebKit/bug_803.py Normal file
View file

@ -0,0 +1,18 @@
import unittest
from PySide.QtGui import *
from PySide.QtWebKit import *
class TestBug803 (unittest.TestCase):
def testIt(self):
app = QApplication([])
page = QWebPage()
frame = page.mainFrame()
frame.setHtml("<html><head></head><body><p>1</p><p>2</p></body></html>")
elems = frame.findAllElements("p")
self.assertEqual(len(elems), 2)
self.assertEqual(elems[0].toPlainText(), "1")
self.assertEqual(elems[1].toPlainText(), "2")
if __name__ == "__main__":
unittest.main()