Fixing several tests
Using isinstance instead of comparing classes names Removing unnecessary tuple check, treated by the return value unpacking Adding missing inject code tests Adding qfile.getchar test Fixing QLocale.to* methods fixing __setitem__ in qbytearray
This commit is contained in:
parent
76529055ff
commit
74351882b5
13 changed files with 291 additions and 45 deletions
33
tests/qtcore/qchar_test.py
Normal file
33
tests/qtcore/qchar_test.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
|
||||
'''Test cases for QChar'''
|
||||
|
||||
import unittest
|
||||
|
||||
from PySide.QtCore import QString, QChar, QTextStream, QLatin1Char
|
||||
|
||||
|
||||
class EqualTest(unittest.TestCase):
|
||||
'''Tests for '__equal__'''
|
||||
|
||||
def testEqualQChar(self):
|
||||
'''QChar == QChar'''
|
||||
self.assertEqual(QChar('a'), QChar('a'))
|
||||
|
||||
def testEqualPyString(self):
|
||||
'''QChar == Python string'''
|
||||
self.assertEqual(QChar('a'), 'a')
|
||||
|
||||
|
||||
class ImplicitConvQLatin1Char(unittest.TestCase):
|
||||
'''Tests for implicit conversion from QLatin1Char to QChar'''
|
||||
|
||||
def testQLatin1CharToChar(self):
|
||||
'''QLatin1Char implicitly convertible to QChar'''
|
||||
stream = QTextStream()
|
||||
stream.setPadChar(QLatin1Char('-'))
|
||||
self.assertEqual(QChar('-'), stream.padChar())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue