mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-09-05 17:30:26 +02:00
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@69095 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
32 lines
1.1 KiB
Python
32 lines
1.1 KiB
Python
import imp_unittest, unittest
|
|
import wx
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
class ArrayString(unittest.TestCase):
|
|
|
|
if hasattr(wx, 'testArrayStringTypemap'):
|
|
def test_ArrayStringTypemaps(self):
|
|
# basic conversion of list or tuples of strings
|
|
seqList = ['a', u'b', 'hello world']
|
|
self.assertEqual(wx.testArrayStringTypemap(seqList), seqList)
|
|
seqTuple = ('a', u'b', 'hello world')
|
|
self.assertEqual(wx.testArrayStringTypemap(seqTuple), list(seqTuple))
|
|
|
|
def test_ArrayStringTypemapErrors(self):
|
|
# test error conditions
|
|
with self.assertRaises(TypeError):
|
|
wx.testArrayStringTypemap("STRING sequence")
|
|
with self.assertRaises(TypeError):
|
|
wx.testArrayStringTypemap(u"UNICODE sequence")
|
|
with self.assertRaises(TypeError):
|
|
wx.testArrayStringTypemap(["list", "with", "non-string", "items", 123])
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|