aboutsummaryrefslogtreecommitdiffstats
path: root/tests/qtcore/qbytearray_buffer_protocol_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/qtcore/qbytearray_buffer_protocol_test.py')
-rwxr-xr-xtests/qtcore/qbytearray_buffer_protocol_test.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/qtcore/qbytearray_buffer_protocol_test.py b/tests/qtcore/qbytearray_buffer_protocol_test.py
new file mode 100755
index 000000000..6e81f1e03
--- /dev/null
+++ b/tests/qtcore/qbytearray_buffer_protocol_test.py
@@ -0,0 +1,25 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+'''Tests QByteArray implementation of Python buffer protocol'''
+
+import unittest
+
+from os.path import isdir
+from PySide.QtCore import QByteArray
+
+class QByteArrayBufferProtocolTest(unittest.TestCase):
+ '''Tests QByteArray implementation of Python buffer protocol'''
+
+ def testQByteArrayBufferProtocol(self):
+ #Tests QByteArray implementation of Python buffer protocol using the os.path.isdir
+ #function which an unicode object or other object implementing the Python buffer protocol
+ os_path_isdir_function_correctly_called_with_a_qbytearray = True
+ try:
+ isdir(QByteArray('/tmp'))
+ except:
+ os_path_isdir_function_correctly_called_with_a_qbytearray = False
+ self.assertTrue(os_path_isdir_function_correctly_called_with_a_qbytearray)
+
+if __name__ == '__main__':
+ unittest.main()
+