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
|
|
@ -57,5 +57,26 @@ class QByteArrayOperatorAt(unittest.TestCase):
|
|||
self.assertRaises(IndexError, lambda :obj[len(string)])
|
||||
|
||||
|
||||
class QByteArrayOperatorLen(unittest.TestCase):
|
||||
'''Test case for __len__ operator of QByteArray'''
|
||||
|
||||
def testBasic(self):
|
||||
'''QByteArray __len__'''
|
||||
self.assertEqual(len(QByteArray()), 0)
|
||||
self.assertEqual(len(QByteArray('')), 0)
|
||||
self.assertEqual(len(QByteArray(' ')), 1)
|
||||
self.assertEqual(len(QByteArray('yabadaba')), 8)
|
||||
|
||||
|
||||
class QByteArrayOperatorStr(unittest.TestCase):
|
||||
'''Test case for __str__ operator of QByteArray'''
|
||||
|
||||
def testBasic(self):
|
||||
'''QByteArray __str__'''
|
||||
self.assertEqual(QByteArray().__str__(), '')
|
||||
self.assertEqual(QByteArray('').__str__(), '')
|
||||
self.assertEqual(QByteArray('aaa').__str__(), 'aaa')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue