Fix bug 934 - "A __getitem__ of QByteArray behaves strange"

This commit is contained in:
Hugo Parente Lima 2011-07-21 16:25:22 -03:00
commit 0b6bafdd44
2 changed files with 5 additions and 1 deletions

View file

@ -56,6 +56,10 @@ class QByteArrayOperatorAt(unittest.TestCase):
obj = QByteArray(string)
self.assertRaises(IndexError, lambda :obj[len(string)])
def testNullStrings(self):
ba = QByteArray('\x00')
self.assertEqual(ba.at(0), '\x00')
self.assertEqual(ba[0], '\x00')
class QByteArrayOperatorLen(unittest.TestCase):
'''Test case for __len__ operator of QByteArray'''