MCPcopy Index your code
hub / github.com/python/cpython / test_find_again

Method test_find_again

Lib/idlelib/idle_test/test_search.py:34–57  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

32 self.text.insert('1.0', 'Hello World!')
33
34 def test_find_again(self):
35 # Search for various expressions
36 text = self.text
37
38 self.engine.setpat('')
39 self.assertFalse(self.dialog.find_again(text))
40 self.dialog.bell = lambda: None
41
42 self.engine.setpat('Hello')
43 self.assertTrue(self.dialog.find_again(text))
44
45 self.engine.setpat('Goodbye')
46 self.assertFalse(self.dialog.find_again(text))
47
48 self.engine.setpat('World!')
49 self.assertTrue(self.dialog.find_again(text))
50
51 self.engine.setpat('Hello World!')
52 self.assertTrue(self.dialog.find_again(text))
53
54 # Regular expression
55 self.engine.revar = BooleanVar(self.root, True)
56 self.engine.setpat('W[aeiouy]r')
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

Callers

nothing calls this directly

Calls 5

BooleanVarClass · 0.90
setpatMethod · 0.80
assertFalseMethod · 0.80
find_againMethod · 0.80
assertTrueMethod · 0.80

Tested by

no test coverage detected