Back to index

python3.2  3.2.2
Public Member Functions
tkinter.test.test_ttk.test_widgets.RadiobuttonTest Class Reference

List of all members.

Public Member Functions

def test_invoke

Detailed Description

Definition at line 427 of file test_widgets.py.


Member Function Documentation

Definition at line 429 of file test_widgets.py.

00429 
00430     def test_invoke(self):
00431         success = []
00432         def cb_test():
00433             success.append(1)
00434             return "cb test called"
00435 
00436         myvar = tkinter.IntVar()
00437         cbtn = ttk.Radiobutton(command=cb_test, variable=myvar, value=0)
00438         cbtn2 = ttk.Radiobutton(command=cb_test, variable=myvar, value=1)
00439 
00440         res = cbtn.invoke()
00441         self.assertEqual(res, "cb test called")
00442         self.assertEqual(cbtn['value'], myvar.get())
00443         self.assertEqual(myvar.get(),
00444             cbtn.tk.globalgetvar(cbtn['variable']))
00445         self.assertTrue(success)
00446 
00447         cbtn2['command'] = ''
00448         res = cbtn2.invoke()
00449         self.assertEqual(res, '')
00450         self.assertFalse(len(success) > 1)
00451         self.assertEqual(cbtn2['value'], myvar.get())
00452         self.assertEqual(myvar.get(),
00453             cbtn.tk.globalgetvar(cbtn['variable']))
00454 
00455         self.assertEqual(str(cbtn['variable']), str(cbtn2['variable']))
00456 
00457 

Here is the call graph for this function:


The documentation for this class was generated from the following file: