aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtCore
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-04-06 19:04:56 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:08 -0300
commitc06cec65df9db1b580cb24d43bfc6a5f46b20f17 (patch)
treeaf76f7f32fa13d995b558a2d78f8e2b56a7e0bd6 /tests/QtCore
parent6ef7460a47674072b2dd2f8521bea8c84f7153d5 (diff)
Fix bug 724 - "Missing QAbstractFileEngine.map method"
Diffstat (limited to 'tests/QtCore')
-rw-r--r--tests/QtCore/CMakeLists.txt1
-rw-r--r--tests/QtCore/bug_724.py22
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index 48de2c4bb..cbc9ee0b3 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -8,6 +8,7 @@ PYSIDE_TEST(bug_515.py)
PYSIDE_TEST(bug_656.py)
PYSIDE_TEST(bug_699.py)
PYSIDE_TEST(bug_706.py)
+PYSIDE_TEST(bug_724.py)
PYSIDE_TEST(blocking_signals_test.py)
PYSIDE_TEST(child_event_test.py)
PYSIDE_TEST(deepcopy_test.py)
diff --git a/tests/QtCore/bug_724.py b/tests/QtCore/bug_724.py
new file mode 100644
index 000000000..550b53f2b
--- /dev/null
+++ b/tests/QtCore/bug_724.py
@@ -0,0 +1,22 @@
+from PySide.QtCore import *
+import unittest
+import tempfile
+import os
+
+class TestBug724 (unittest.TestCase):
+
+ def testIt(self):
+ # creates a temporary file
+ handle, self.filename = tempfile.mkstemp()
+ os.write(handle, 'a')
+ os.close(handle)
+
+ engine = QAbstractFileEngine.create(self.filename)
+ engine.open(QIODevice.ReadOnly)
+ memory = engine.map(0, 1, QFile.NoOptions)
+ self.assertEqual(len(memory), 1)
+ self.assertEqual(memory[0], 'a')
+ engine.unmap(memory)
+
+if __name__ == '__main__':
+ unittest.main()