aboutsummaryrefslogtreecommitdiffstats
path: root/tests/qtcore/qstring_buffer_protocol_test.py
blob: 6ce6167dc377ecbdab2fb7ab254d0016a6ffee88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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()