From 8bdff2cf2a7f651ba351ce6734fc96f06994aef4 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 13 May 2016 19:37:33 -0700 Subject: [PATCH] fixes in the metafile test --- unittests/test_metafile.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/unittests/test_metafile.py b/unittests/test_metafile.py index d622a96a..e52ce01d 100644 --- a/unittests/test_metafile.py +++ b/unittests/test_metafile.py @@ -2,21 +2,27 @@ import unittest import wtc import wx import wx.msw -import os -fileName = 'metafiletest.emf' #--------------------------------------------------------------------------- class MetafileDCTests(wtc.WidgetTestCase): - @unittest.skipIf('wxMSW' in wx.PlatformInfo, "Metafile classes only implemented on Windows") + @unittest.skipIf('wxMSW' not in wx.PlatformInfo, "Metafile classes only imsplemented on Windows") def test_MetafileDC1(self): - dc = wx.msw.MetafileDC(fileName) + # Not testing with output file because it is not released soon enough + # for this tests to be able to delete the file in this test, resulting + # in permission errors. + dc = wx.msw.MetafileDC() dc.DrawLine(0,0, 50,50) + metafile = dc.Close() del dc - - os.remove(fileName) + + self.assertTrue(isinstance(metafile, wx.msw.Metafile)) + metafile.SetClipboard(50,50) + metafile.Play(wx.ClientDC(self.frame)) + del metafile + #---------------------------------------------------------------------------