diff --git a/unittests/test_xrc.py b/unittests/test_xrc.py index 73318b41..637e8e64 100644 --- a/unittests/test_xrc.py +++ b/unittests/test_xrc.py @@ -40,7 +40,7 @@ class xrc_Tests(wtc.WidgetTestCase): xmlres = xrc.XmlResource() with open(xrcFile, 'rb') as f: data = f.read() - xmlres.LoadFromString(data) + xmlres.LoadFromBuffer(data) self.checkXmlRes(xmlres) def test_xrc4(self): @@ -91,7 +91,7 @@ class xrc_Tests(wtc.WidgetTestCase): def OnSize(self, evt): sz = self.GetSize() w, h = self.t.GetTextExtent(self.t.GetLabel()) - self.t.SetPosition(((sz.width-w)/2, (sz.height-h)/2)) + self.t.SetPosition(((sz.width-w)//2, (sz.height-h)//2)) # this is the handler class that will create the resource item @@ -127,7 +127,7 @@ class xrc_Tests(wtc.WidgetTestCase): # now load it xmlres = xrc.XmlResource() xmlres.InsertHandler( MyCustomPanelXmlHandler() ) - success = xmlres.LoadFromString(resource) + success = xmlres.LoadFromBuffer(resource) f = xmlres.LoadFrame(self.frame, 'MainFrame') self.assertNotEqual(f, None) @@ -178,7 +178,7 @@ class xrc_Tests(wtc.WidgetTestCase): def OnSize(self, evt): sz = self.GetSize() w, h = self.t.GetTextExtent(self.t.GetLabel()) - self.t.SetPosition(((sz.width-w)/2, (sz.height-h)/2)) + self.t.SetPosition(((sz.width-w)//2, (sz.height-h)//2)) # this is the handler class that will create the resource item @@ -215,7 +215,7 @@ class xrc_Tests(wtc.WidgetTestCase): # now load it xmlres = xrc.XmlResource() xmlres.InsertHandler( MyCustomPanelXmlHandler() ) - success = xmlres.LoadFromString(resource) + success = xmlres.LoadFromBuffer(resource) f = xmlres.LoadFrame(self.frame, 'MainFrame') self.assertNotEqual(f, None) @@ -246,7 +246,7 @@ class xrc_Tests(wtc.WidgetTestCase): # now load it xmlres = xrc.XmlResource() - success = xmlres.LoadFromString(resource) + success = xmlres.LoadFromBuffer(resource) panel = xmlres.LoadPanel(self.frame, "MyPanel") self.frame.SendSizeEvent() diff --git a/unittests/xrcfactorytest.py b/unittests/xrcfactorytest.py index 1ce34b77..5a884e52 100644 --- a/unittests/xrcfactorytest.py +++ b/unittests/xrcfactorytest.py @@ -31,5 +31,5 @@ class MyCustomPanel(wx.Panel): if hasattr(self, 't'): sz = self.GetSize() w, h = self.t.GetTextExtent(self.t.GetLabel()) - self.t.SetPosition(((sz.width-w)/2, (sz.height-h)/2)) + self.t.SetPosition(((sz.width-w)//2, (sz.height-h)//2))