mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-12-16 09:40:07 +01:00
unittests: removed ...vec2d.py and amended ...pdfviewer.py
This commit is contained in:
@@ -8,7 +8,7 @@ try:
|
||||
from wx.lib.pdfviewer import pdfViewer, pdfButtonPanel
|
||||
havePyPDF = True
|
||||
except ImportError:
|
||||
havePyPDF = False # Assume an import error is due to missing pyPdf
|
||||
havePyPDF = False # Assume neither PyMuPDF nor PyPDF2 found
|
||||
|
||||
dataDir = os.path.join(os.path.dirname(__file__), "data")
|
||||
samplePdf = os.path.join(dataDir, "sample.pdf")
|
||||
@@ -18,19 +18,19 @@ samplePdf = os.path.join(dataDir, "sample.pdf")
|
||||
@unittest.skipIf('wxMac' in wx.PlatformInfo or 'wxGTK' in wx.PlatformInfo,
|
||||
'test is crashing on Mac and GTK...')
|
||||
class lib_pdfviewer_pdfviewer_Tests(wtc.WidgetTestCase):
|
||||
|
||||
@unittest.skipIf(not havePyPDF, "pyPdf required")
|
||||
|
||||
@unittest.skipIf(not havePyPDF, "PyMuPDF or PyPDF2 required")
|
||||
def test_lib_pdfviewer_pdfviewerButtonPanelCtor(self):
|
||||
bp = pdfButtonPanel(self.frame, wx.NewId(),
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
|
||||
@unittest.skipIf(not havePyPDF, "pyPdf required")
|
||||
@unittest.skipIf(not havePyPDF, "PyMuPDF or PyPDF2 required")
|
||||
def test_lib_pdfviewer_pdfviewerPdfViewerCtor(self):
|
||||
pv = pdfViewer(self.frame, wx.NewId(), wx.DefaultPosition,
|
||||
wx.DefaultSize,
|
||||
wx.HSCROLL|wx.VSCROLL|wx.SUNKEN_BORDER)
|
||||
|
||||
@unittest.skipIf(not havePyPDF, "pyPdf required")
|
||||
@unittest.skipIf(not havePyPDF, "PyMuPDF or PyPDF2 required")
|
||||
def test_lib_pdfviewer_loadFile(self):
|
||||
paneCont = sc.SizedPanel(self.frame)
|
||||
|
||||
@@ -40,16 +40,15 @@ class lib_pdfviewer_pdfviewer_Tests(wtc.WidgetTestCase):
|
||||
self.viewer = pdfViewer(paneCont, wx.NewId(), wx.DefaultPosition,
|
||||
wx.DefaultSize,
|
||||
wx.HSCROLL|wx.VSCROLL|wx.SUNKEN_BORDER)
|
||||
self.viewer.UsePrintDirect = False
|
||||
self.viewer.SetSizerProps(expand=True, proportion=1)
|
||||
|
||||
# introduce buttonpanel and viewer to each other
|
||||
self.buttonpanel.viewer = self.viewer
|
||||
self.viewer.buttonpanel = self.buttonpanel
|
||||
|
||||
|
||||
self.viewer.LoadFile(samplePdf)
|
||||
self.waitFor(500)
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user