Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
tkinter.test.test_tkinter.test_text.TextTest Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test_search

Public Attributes

 root
 text

Detailed Description

Definition at line 8 of file test_text.py.


Member Function Documentation

Definition at line 10 of file test_text.py.

00010 
00011     def setUp(self):
00012         self.root = setup_master()
00013         self.text = tkinter.Text(self.root)

Here is the caller graph for this function:

Definition at line 14 of file test_text.py.

00014 
00015     def tearDown(self):
00016         self.text.destroy()
00017 

Here is the caller graph for this function:

Definition at line 18 of file test_text.py.

00018 
00019     def test_search(self):
00020         text = self.text
00021 
00022         # pattern and index are obligatory arguments.
00023         self.assertRaises(tkinter.TclError, text.search, None, '1.0')
00024         self.assertRaises(tkinter.TclError, text.search, 'a', None)
00025         self.assertRaises(tkinter.TclError, text.search, None, None)
00026 
00027         # Invalid text index.
00028         self.assertRaises(tkinter.TclError, text.search, '', 0)
00029 
00030         # Check if we are getting the indices as strings -- you are likely
00031         # to get Tcl_Obj under Tk 8.5 if Tkinter doesn't convert it.
00032         text.insert('1.0', 'hi-test')
00033         self.assertEqual(text.search('-test', '1.0', 'end'), '1.2')
00034         self.assertEqual(text.search('test', '1.0', 'end'), '1.3')
00035 

Here is the call graph for this function:


Member Data Documentation

Definition at line 11 of file test_text.py.

Definition at line 12 of file test_text.py.


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