Files
Phoenix/unittests/test_arrayint.py
Robin Dunn 4219e02440 * move wxPen to etg/pen.py
* move wxBrush to etg/brush.py
* move wxBookCtrlBase and wxBookCtrlEvent to etg/bookctrl.py
* move wxBitmapButton to etg/bmpbuttn.py
* move wxArrayString MappedType and add wxArrayInt plus some unittests
* add checking for default values for pos and size parameters in fixWindowClass
* set out parameter flags for wxImageHistogram.FindFirstUnusedColour
* Restore layout constraints classes and related methods
* Create a MappedType for wxClientData
* update used of wxClientData in wx.CommandEvent
* Move wxControlWithItems, wxItemContainer and wxControlWithItems to etg/ctrlsub.py
* enable some Append, Insert and Set overloads in wxControlWithItems
* addGetterSetterProps: don't make setter-only properties
* addGetterSetterProps: ensure that the getter can be called with zero args
* addGetterSetterProps: ensure that the setter can be called with just 1 arg
* restore version checking code
* moved DC classes to other etg files to match interface file names.
* allow both overloads for wx.DC.GetTextExtent and GetMultiLineTextExtent by renaming 1
* add wx.DC.GetPartialTextExtents
* and some other stuff

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@68975 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-09-03 01:42:42 +00:00

28 lines
925 B
Python

import unittest2
import wxPhoenix as wx
#---------------------------------------------------------------------------
class ArrayInt(unittest2.TestCase):
if hasattr(wx, 'testArrayIntTypemap'):
def test_ArrayStringTypemaps(self):
# basic conversion of list or tuples of numbers
seqList = [1,2,3,4.5,6.7]
self.assertEqual(wx.testArrayIntTypemap(seqList), [1,2,3,4,6]) #floats are truncated to int
seqTuple = (1,2,3,4.5,6.7)
self.assertEqual(wx.testArrayIntTypemap(seqTuple), [1,2,3,4,6])
def test_ArrayIntTypemapErrors(self):
# test error conditions
with self.assertRaises(TypeError):
wx.testArrayIntTypemap([1,2,3, "baditem", ["listitem"]])
#---------------------------------------------------------------------------
if __name__ == '__main__':
unittest2.main()