Revert "We do not support character buffer protocol on QStrings."
This reverts commit 1a7cbb2473.
This commit is contained in:
parent
8cd100beee
commit
3592cd622e
1 changed files with 25 additions and 0 deletions
25
tests/qtcore/qstring_buffer_protocol_test.py
Executable file
25
tests/qtcore/qstring_buffer_protocol_test.py
Executable file
|
|
@ -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()
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue