summaryrefslogtreecommitdiffstats
path: root/tests/QtCore/bug_994.py
blob: 74e352c8fd24ce066758464d3b0e774054a77676 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import unittest
from PySide.QtCore import *

class MyIODevice (QIODevice):
    def readData(self, amount):
        return "\0a" * (amount/2)

    def atEnd(self):
        return False

class TestBug944 (unittest.TestCase):

    def testIt(self):
        device = MyIODevice()
        device.open(QIODevice.ReadOnly)
        s = QTextStream(device)
        self.assertEqual(s.read(4), "\0a\0a")

if __name__ == "__main__":
    unittest.main()