diff options
author | Hugo Lima <hugo.lima@openbossa.org> | 2010-01-27 16:59:56 -0200 |
---|---|---|
committer | Hugo Lima <hugo.lima@openbossa.org> | 2010-01-27 16:59:56 -0200 |
commit | 3592cd622e61ee689b096c99d46b6d936109e383 (patch) | |
tree | a436899e39d55efaab60cb292d17948cdad71a53 /tests/qtcore/qstring_buffer_protocol_test.py | |
parent | 8cd100beee09b2bd8305e124fb52fc1f5025584c (diff) |
Revert "We do not support character buffer protocol on QStrings."
This reverts commit 1a7cbb2473327abad936447c47818ee13df2992c.
Diffstat (limited to 'tests/qtcore/qstring_buffer_protocol_test.py')
-rwxr-xr-x | tests/qtcore/qstring_buffer_protocol_test.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/qtcore/qstring_buffer_protocol_test.py b/tests/qtcore/qstring_buffer_protocol_test.py new file mode 100755 index 000000000..6ce6167dc --- /dev/null +++ b/tests/qtcore/qstring_buffer_protocol_test.py @@ -0,0 +1,25 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +'''Tests QString implementation of Python buffer protocol''' + +import unittest + +from os.path import isdir +from PySide.QtCore import QString + +class QStringBufferProtocolTest(unittest.TestCase): + '''Tests QString implementation of Python buffer protocol''' + + def testQStringBufferProtocol(self): + #Tests QString 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_qstring = True + try: + isdir(QString('/tmp')) + except: + os_path_isdir_function_correctly_called_with_a_qstring = False + self.assertTrue(os_path_isdir_function_correctly_called_with_a_qstring) + +if __name__ == '__main__': + unittest.main() + |