mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-04 11:00:07 +01:00
35 lines
933 B
Python
35 lines
933 B
Python
import unittest
|
|
import wtc
|
|
import wx
|
|
|
|
import wx.lib.six as six
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
class variant_Tests(wtc.WidgetTestCase):
|
|
|
|
@unittest.skipIf(not hasattr(wx, 'testVariantTypemap'), '')
|
|
def test_variant1(self):
|
|
n = wx.testVariantTypemap(123)
|
|
self.assertTrue(isinstance(n, six.integer_types))
|
|
self.assertEqual(n, 123)
|
|
|
|
|
|
@unittest.skipIf(not hasattr(wx, 'testVariantTypemap'), '')
|
|
def test_variant2(self):
|
|
s = wx.testVariantTypemap("Hello")
|
|
self.assertEqual(s, "Hello")
|
|
|
|
|
|
@unittest.skipIf(not hasattr(wx, 'testVariantTypemap'), '')
|
|
def test_variant3(self):
|
|
d1 = dict(a=1, b=2, c=3)
|
|
d2 = wx.testVariantTypemap(d1)
|
|
self.assertEqual(d1, d2)
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|