aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtCore
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-02-04 18:24:07 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:53:54 -0300
commit44998fd471927efb8c7a55e5bd7b81bad9f6e876 (patch)
treeef930c2935faab26d27c5ded94b1876a66880807 /tests/QtCore
parent59c882566be0d58c256f715ce675f10f3181ccc3 (diff)
Fix 666 - "QByteArray does not support slices"
Reviewer: Renato Araújo <renato.filho@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'tests/QtCore')
-rw-r--r--tests/QtCore/qbytearray_test.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/QtCore/qbytearray_test.py b/tests/QtCore/qbytearray_test.py
index 396545f4e..fa838c19f 100644
--- a/tests/QtCore/qbytearray_test.py
+++ b/tests/QtCore/qbytearray_test.py
@@ -105,6 +105,15 @@ class QByteArrayOnQVariant(unittest.TestCase):
a = QSettings().value("some_prop", QByteArray())
self.assertEqual(type(a), QByteArray)
+class TestBug666(unittest.TestCase):
+ '''QByteArray does not support slices'''
+ def testIt(self):
+ ba = QByteArray('1234567890')
+ self.assertEqual(ba[2:4], '34')
+ self.assertEqual(ba[:4], '1234')
+ self.assertEqual(ba[4:], '567890')
+ self.assertEqual(len(ba[4:1]), 0)
+
class QByteArrayBug514(unittest.TestCase):
def testIt(self):
data = "foobar"