<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mediawiki.zeropage.org/index.php?action=history&amp;feed=atom&amp;title=GuiTestingWithWxPython</id>
	<title>GuiTestingWithWxPython - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mediawiki.zeropage.org/index.php?action=history&amp;feed=atom&amp;title=GuiTestingWithWxPython"/>
	<link rel="alternate" type="text/html" href="https://mediawiki.zeropage.org/index.php?title=GuiTestingWithWxPython&amp;action=history"/>
	<updated>2026-05-15T20:20:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://mediawiki.zeropage.org/index.php?title=GuiTestingWithWxPython&amp;diff=32023&amp;oldid=prev</id>
		<title>imported&gt;Unknown at 05:23, 7 February 2021</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.zeropage.org/index.php?title=GuiTestingWithWxPython&amp;diff=32023&amp;oldid=prev"/>
		<updated>2021-02-07T05:23:20Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;TDD로 컨트롤을 하나하나 붙이고 위치값을 잡고 리스트박스에 초기값을 설정하는 예제&lt;br /&gt;
== test_myframe.py ==&lt;br /&gt;
 from wxPython.wx import * &lt;br /&gt;
 import unittest &lt;br /&gt;
 from MyFrame import MyFrame&lt;br /&gt;
  &lt;br /&gt;
 class TestFrame(unittest.TestCase): &lt;br /&gt;
         def setUp(self): &lt;br /&gt;
                 self.frame = MyFrame() &lt;br /&gt;
  &lt;br /&gt;
         def tearDown(self): &lt;br /&gt;
                 self.frame.Destroy() &lt;br /&gt;
                 self.frame = None &lt;br /&gt;
  &lt;br /&gt;
         def testFramePositionSize(self): &lt;br /&gt;
                 expected = (400,400) &lt;br /&gt;
                 self.assertEquals(expected, self.frame.GetSizeTuple()) &lt;br /&gt;
                 self.assertEquals(expected, self.frame.GetPositionTuple()) &lt;br /&gt;
  &lt;br /&gt;
         def testControls(self): &lt;br /&gt;
                 pass &lt;br /&gt;
  &lt;br /&gt;
         def testbuttonText(self): &lt;br /&gt;
                 expected = &amp;quot;testing&amp;quot; &lt;br /&gt;
                 result = self.frame.button.GetLabel() &lt;br /&gt;
                 self.assertEquals(expected, result) &lt;br /&gt;
  &lt;br /&gt;
         def testButtonRect(self): &lt;br /&gt;
                 expected = (100,100) &lt;br /&gt;
                 result = self.frame.button.GetPositionTuple() &lt;br /&gt;
                 self.assertEquals(expected, result) &lt;br /&gt;
                 expected = (200,50) &lt;br /&gt;
                 result = self.frame.button.GetSizeTuple() &lt;br /&gt;
                 self.assertEquals(expected, result) &lt;br /&gt;
  &lt;br /&gt;
         def testListBox(self): &lt;br /&gt;
                 expected = (&amp;#039;testing1&amp;#039;, &amp;#039;testing2&amp;#039;, &amp;#039;testing3&amp;#039;) &lt;br /&gt;
                 self.assertEquals(expected, self.frame.getListItemsTuple()) &lt;br /&gt;
  &lt;br /&gt;
 class TestApp(wxApp): &lt;br /&gt;
         def OnInit(self): &lt;br /&gt;
             return true &lt;br /&gt;
 &lt;br /&gt;
 if __name__==&amp;quot;__main__&amp;quot;: &lt;br /&gt;
     testApp=TestApp(0)&lt;br /&gt;
     unittest.main(argv=(&amp;#039;&amp;#039;,&amp;#039;-v&amp;#039;))&lt;br /&gt;
&lt;br /&gt;
== myframe.py ==&lt;br /&gt;
 from wxPython.wx import *&lt;br /&gt;
 &lt;br /&gt;
 class MyFrame(wxFrame):&lt;br /&gt;
 	def __init__(self, parent=NULL, id=NewId(), title=&amp;#039;test&amp;#039;, pos=(400,400), size=(400,400)):&lt;br /&gt;
 		wxFrame.__init__(self, parent, id, title, pos, size)&lt;br /&gt;
 &lt;br /&gt;
 		ID_BUTTON = 10000&lt;br /&gt;
 		self.button = wxButton(self, ID_BUTTON, &amp;quot;testing&amp;quot;, pos=(100,100), size=(200,50))&lt;br /&gt;
 		self.SetAutoLayout(true)&lt;br /&gt;
 		#pdb.set_trace()&lt;br /&gt;
 		self.listBox = wxListBox(self, NewId())&lt;br /&gt;
 		self.listBox.Append(&amp;#039;testing1&amp;#039;)&lt;br /&gt;
 		self.listBox.Append(&amp;#039;testing2&amp;#039;)&lt;br /&gt;
 		self.listBox.Append(&amp;#039;testing3&amp;#039;)&lt;br /&gt;
 &lt;br /&gt;
 	def getListItemsTuple(self):&lt;br /&gt;
 		retList = []&lt;br /&gt;
 		for idx in range(self.listBox.Number()):&lt;br /&gt;
 			retList.append(self.listBox.GetString(idx))&lt;br /&gt;
 &lt;br /&gt;
 		return tuple(retList)&lt;br /&gt;
 &lt;br /&gt;
 class MyApp(wxApp):&lt;br /&gt;
 	def OnInit(self):&lt;br /&gt;
 		frame = MyFrame()&lt;br /&gt;
 		frame.Show(true)&lt;br /&gt;
 		return true&lt;br /&gt;
 		&lt;br /&gt;
 if __name__==&amp;quot;__main__&amp;quot;:&lt;br /&gt;
 	App = MyApp(0)&lt;br /&gt;
 	App.MainLoop()&lt;br /&gt;
----&lt;br /&gt;
[[GuiTesting]]&lt;br /&gt;
&lt;/div&gt;</summary>
		<author><name>imported&gt;Unknown</name></author>
	</entry>
</feed>