Unit test for bug862 - "Problems when printing objects"
This commit is contained in:
parent
801efd40f3
commit
596f8347e2
2 changed files with 41 additions and 0 deletions
|
|
@ -61,6 +61,7 @@ PYSIDE_TEST(bug_834.py)
|
||||||
PYSIDE_TEST(bug_836.py)
|
PYSIDE_TEST(bug_836.py)
|
||||||
PYSIDE_TEST(bug_844.py)
|
PYSIDE_TEST(bug_844.py)
|
||||||
PYSIDE_TEST(bug_854.py)
|
PYSIDE_TEST(bug_854.py)
|
||||||
|
PYSIDE_TEST(bug_862.py)
|
||||||
PYSIDE_TEST(customproxywidget_test.py)
|
PYSIDE_TEST(customproxywidget_test.py)
|
||||||
PYSIDE_TEST(deepcopy_test.py)
|
PYSIDE_TEST(deepcopy_test.py)
|
||||||
PYSIDE_TEST(event_filter_test.py)
|
PYSIDE_TEST(event_filter_test.py)
|
||||||
|
|
|
||||||
40
tests/QtGui/bug_862.py
Normal file
40
tests/QtGui/bug_862.py
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
|
||||||
|
from PySide.QtCore import QObject
|
||||||
|
from PySide.QtGui import *
|
||||||
|
import PySide.QtCore
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
class MyQObject(QObject):
|
||||||
|
def __init__(self):
|
||||||
|
QObject.__init__(self)
|
||||||
|
|
||||||
|
class MyQWidget(QWidget):
|
||||||
|
def __init__(self):
|
||||||
|
QWidget.__init__(self)
|
||||||
|
|
||||||
|
class MyQGraphicsObject(QGraphicsObject):
|
||||||
|
def __init__(self):
|
||||||
|
QGraphicsObject.__init__(self)
|
||||||
|
|
||||||
|
class MyQGraphicsItem(QGraphicsItem):
|
||||||
|
def __init__(self):
|
||||||
|
QGraphicsItem.__init__(self)
|
||||||
|
|
||||||
|
class TestRepr (unittest.TestCase):
|
||||||
|
|
||||||
|
def testIt(self):
|
||||||
|
|
||||||
|
app = QApplication([])
|
||||||
|
|
||||||
|
self.assertEqual("<__main__.MyQObject object at ", repr(MyQObject())[:30])
|
||||||
|
self.assertEqual("<__main__.MyQWidget object at ", repr(MyQWidget())[:30])
|
||||||
|
self.assertEqual("<__main__.MyQGraphicsObject(this = 0x", repr(MyQGraphicsObject())[:37])
|
||||||
|
self.assertEqual("<__main__.MyQGraphicsItem(this = 0x", repr(MyQGraphicsItem())[:35])
|
||||||
|
|
||||||
|
self.assertEqual("<PySide.QtCore.QObject object at ", repr(QObject())[:33])
|
||||||
|
self.assertEqual("<PySide.QtCore.QObject object at ", repr(PySide.QtCore.QObject())[:33])
|
||||||
|
self.assertEqual("<PySide.QtGui.QWidget object at ", repr(QWidget())[:32])
|
||||||
|
self.assertEqual("<PySide.QtGui.QGraphicsWidget(this = 0x", repr(QGraphicsWidget())[:39])
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue