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:
Lauro Neto 2010-02-01 18:00:43 -03:00 • committed by Hugo Lima
commit 74351882b5
13 changed files with 291 additions and 45 deletions

View 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()