~ubuntu-branches/ubuntu/utopic/pyside/utopic

« back to all changes in this revision

Viewing changes to tests/QtGui/bug_400.py

  • Committer: Bazaar Package Importer
  • Author(s): Didier Raboud
  • Date: 2011-02-18 18:01:00 UTC
  • mfrom: (1.2.3 upstream) (6.1.6 experimental)
  • Revision ID: james.westby@ubuntu.com-20110218180100-vaczjij7g08fzfme
Tags: 1.0.0~rc1-1
* New 1.0.0~rc1 upstream release
  - Bump the B-D chain versions:
    + apiextractor to 0.10.0-2~
    + generatorrunner to 0.6.6
    + shiboken to 1.0.0~rc1
* Update patches to ~rc1.
* debian/watch: update to handle Release Candidates too.
* Bump XS-Python-Version to >= 2.6.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
''' Test bug 389: http://bugs.openbossa.org/show_bug.cgi?id=389'''
 
2
 
 
3
import unittest
 
4
from helper import UsesQApplication
 
5
from PySide.QtGui import QTreeWidgetItemIterator, QTreeWidgetItem, QTreeWidget
 
6
 
 
7
class BugTest(UsesQApplication):
 
8
    def testCase(self):
 
9
        treeWidget = QTreeWidget()
 
10
        treeWidget.setColumnCount(1)
 
11
        items = []
 
12
        for i in range(10):
 
13
            items.append(QTreeWidgetItem(None, ["item: %i" % i]))
 
14
 
 
15
        treeWidget.insertTopLevelItems(0, items);
 
16
        _iter = QTreeWidgetItemIterator(treeWidget)
 
17
        index = 0
 
18
        while(_iter.value()):
 
19
            item = _iter.value()
 
20
            self.assert_(item is items[index])
 
21
            index += 1
 
22
            _iter += 1
 
23
 
 
24
 
 
25
if __name__ == '__main__':
 
26
    unittest.main()