(self)
| 57 | self.assertTrue(self.dialog.find_again(text)) |
| 58 | |
| 59 | def test_find_selection(self): |
| 60 | # Select some text and make sure it's found |
| 61 | text = self.text |
| 62 | # Add additional line to find |
| 63 | self.text.insert('2.0', 'Hello World!') |
| 64 | |
| 65 | text.tag_add('sel', '1.0', '1.4') # Select 'Hello' |
| 66 | self.assertTrue(self.dialog.find_selection(text)) |
| 67 | |
| 68 | text.tag_remove('sel', '1.0', 'end') |
| 69 | text.tag_add('sel', '1.6', '1.11') # Select 'World!' |
| 70 | self.assertTrue(self.dialog.find_selection(text)) |
| 71 | |
| 72 | text.tag_remove('sel', '1.0', 'end') |
| 73 | text.tag_add('sel', '1.0', '1.11') # Select 'Hello World!' |
| 74 | self.assertTrue(self.dialog.find_selection(text)) |
| 75 | |
| 76 | # Remove additional line |
| 77 | text.delete('2.0', 'end') |
| 78 | |
| 79 | if __name__ == '__main__': |
| 80 | unittest.main(verbosity=2, exit=2) |
nothing calls this directly
no test coverage detected