test_dcps.py 776 Bytes
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
import unittest
from unittests import wtc
import wx
import sys
import os

fileName = os.path.join(os.path.dirname(__file__), 'dcpstest.svg')

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

class dcps_tests(wtc.WidgetTestCase):

    def test_PostscriptDC1(self):
        pd = wx.PrintData()
        pd.SetPrintMode(wx.PRINT_MODE_FILE)
        pd.SetFilename(fileName)

        dc = wx.PostScriptDC(pd)
        pen = wx.Pen('black')
        self.assertTrue(pen.IsOk())
        dc.StartDoc("message")
        dc.SetPen(pen)
        dc.DrawLine(0,0, 50,50)
        dc.EndDoc()
        del dc

        os.remove(fileName)


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


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