diff options
author | Hugo Lima <hugo.lima@openbossa.org> | 2010-01-21 14:02:19 -0200 |
---|---|---|
committer | Hugo Lima <hugo.lima@openbossa.org> | 2010-01-21 14:02:19 -0200 |
commit | 1a7cbb2473327abad936447c47818ee13df2992c (patch) | |
tree | 218a54e9b94bfc8ca3bf649de8bc2c9e0a1004a1 /tests/qtcore | |
parent | a50ecea26dc7035f32ca90a4118fcb8f0c836f6b (diff) |
We do not support character buffer protocol on QStrings.
The only way of supporting it is storing an 8-bit encoded version of QString
into the QString instance, this will increase the memory usage of QString in 50%,
and we don't want it.
So, if you need to pass QStrings for a python functions which doesn't accept
unicode, just cast yourself the QString to a python string.
Diffstat (limited to 'tests/qtcore')
-rwxr-xr-x | tests/qtcore/qstring_buffer_protocol_test.py | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/tests/qtcore/qstring_buffer_protocol_test.py b/tests/qtcore/qstring_buffer_protocol_test.py deleted file mode 100755 index 6ce6167dc..000000000 --- a/tests/qtcore/qstring_buffer_protocol_test.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/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() - |