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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
|
import unittest
from unittests import wtc
import wx.propgrid as pg
#---------------------------------------------------------------------------
class propgridprops_Tests(wtc.WidgetTestCase):
def test_propgridprops01(self):
o = pg.PGInDialogValidator()
def test_propgridprops02(self):
pg.PG_PROP_PASSWORD
p1 = pg.StringProperty()
p2 = pg.StringProperty('label', 'name', 'value')
s = p2.ValueToString(12345)
assert s == '12345'
def test_propgridprops03(self):
pg.PG_PROPERTY_VALIDATION_ERROR_MESSAGE
pg.PG_PROPERTY_VALIDATION_SATURATE
pg.PG_PROPERTY_VALIDATION_WRAP
o = pg.NumericPropertyValidator(pg.NumericPropertyValidator.Signed)
pg.NumericPropertyValidator.Signed
pg.NumericPropertyValidator.Unsigned
pg.NumericPropertyValidator.Float
def test_propgridprops04(self):
p = pg.IntProperty()
def test_propgridprops05(self):
p = pg.UIntProperty()
def test_propgridprops06(self):
p = pg.FloatProperty()
def test_propgridprops07(self):
pg.PG_PROP_USE_CHECKBOX
pg.PG_PROP_USE_DCC
p = pg.BoolProperty()
def test_propgridprops08(self):
pg.PG_PROP_STATIC_CHOICES
p1 = pg.EnumProperty()
p2 = pg.EnumProperty(label='label', name='name',
labels=['one', 'two', 'three'],
values=[1, 2, 3])
def test_propgridprops09(self):
p1 = pg.EditEnumProperty()
p2 = pg.EditEnumProperty(label='label', name='name',
labels=['one', 'two', 'three'],
values=[1, 2, 3])
def test_propgridprops10(self):
p1 = pg.FlagsProperty()
p2 = pg.FlagsProperty(label='label', name='name',
labels=['one', 'two', 'three'],
values=[1, 2, 3])
def test_propgridprops11(self):
da = pg.PGFileDialogAdapter()
def test_propgridprops12(self):
pg.PG_PROP_SHOW_FULL_FILENAME
p1 = pg.FileProperty()
value = '/foo/bar/value'
p2 = pg.FileProperty('label', 'name', value)
fn = p2.GetFileName()
assert fn == value
def test_propgridprops13(self):
pg.PG_PROP_NO_ESCAPE
da = pg.PGLongStringDialogAdapter()
def test_propgridprops14(self):
p1 = pg.LongStringProperty()
def test_propgridprops15(self):
p1 = pg.DirProperty()
def test_propgridprops16(self):
p1 = pg.ArrayStringProperty()
p2 = pg.ArrayStringProperty(label='label', name='name',
value=['one', 'two', 'three'])
def test_propgridprops17(self):
with self.assertRaises(TypeError):
dlg = pg.PGArrayEditorDialog(self.frame, 'message', 'caption')
dlg.Destroy()
def test_propgridprops18(self):
dlg = pg.PGArrayStringEditorDialog()
dlg.Destroy()
#---------------------------------------------------------------------------
if __name__ == '__main__':
unittest.main()
|