~ubuntu-branches/ubuntu/natty/pyside/natty

« back to all changes in this revision

Viewing changes to tests/QtGui/bug_569.py

  • Committer: Bazaar Package Importer
  • Author(s): Didier Raboud
  • Date: 2011-02-18 18:01:00 UTC
  • mfrom: (1.1.6 upstream)
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: james.westby@ubuntu.com-20110218180100-y8aqmcdbcbd6gpeh
Tags: upstream-1.0.0~rc1
ImportĀ upstreamĀ versionĀ 1.0.0~rc1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from PySide.QtCore import *
 
2
from PySide.QtGui import *
 
3
import unittest
 
4
 
 
5
 
 
6
class TestBug569(unittest.TestCase):
 
7
 
 
8
    def testIt(self):
 
9
        types = (QTableWidgetItem, QListWidgetItem, QTreeWidgetItem)
 
10
        for t in types:
 
11
            a = t()
 
12
            a.__lt__ = lambda(other) : True
 
13
            b = t()
 
14
            b.__lt__ = lambda(other) : False
 
15
            self.assertTrue(a < b)
 
16
            self.assertFalse(b < a)
 
17
 
 
18
if __name__ == '__main__':
 
19
    unittest.main()