test_cmndata.py 1.35 KB
Newer Older
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
import unittest
from unittests import wtc
import wx
import six

#---------------------------------------------------------------------------

class cmndata_tests(wtc.WidgetTestCase):

    def test_cmndataClassConstructors(self):
        psdd1 = wx.PageSetupDialogData()
        pd1 = wx.PrintData()
        pdd1 = wx.PrintDialogData()

        psdd2 = wx.PageSetupDialogData(pd1)
        psdd3 = wx.PageSetupDialogData(psdd2)

        pd2 = wx.PrintData(pd1)

        pdd2 = wx.PrintDialogData(pdd1)
        pdd3 = wx.PrintDialogData(pd1)



    def test_cppMethods(self):
        pd = wx.PrintData()
        data = pd.GetPrivData()
        pd.SetPrivData(data)

        # property for the same methods
        data = pd.PrivData
        pd.PrivData = data


    def test_nonzero(self):
        psdd = wx.PageSetupDialogData()
        pd = wx.PrintData()
        pdd = wx.PrintDialogData()

        if six.PY3:
            psdd.__bool__()
            pd.__bool__()
            pdd.__bool__()
        else:
            psdd.__nonzero__()
            pd.__nonzero__()
            pdd.__nonzero__()


    def test_PD_PaperSize(self):
        pd = wx.PrintData()
        pd.GetPaperSize()
        pd.SetPaperSize( wx.Size(8.5*300, 11*300) )
        pd.PaperSize


#---------------------------------------------------------------------------


if __name__ == '__main__':
    unittest.main()