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

Method test_init

Lib/idlelib/idle_test/test_hyperparser.py:64–82  ·  view source on GitHub ↗

test corner cases in the init method

(self)

Source from the content-addressed store, hash-verified

62 return HyperParser(self.editwin, index)
63
64 def test_init(self):
65 """
66 test corner cases in the init method
67 """
68 with self.assertRaises(ValueError) as ve:
69 self.text.tag_add('console', '1.0', '1.end')
70 p = self.get_parser('1.5')
71 self.assertIn('precedes', str(ve.exception))
72
73 # test without ps1
74 self.editwin.prompt_last_line = ''
75
76 # number of lines lesser than 50
77 p = self.get_parser('end')
78 self.assertEqual(p.rawtext, self.text.get('1.0', 'end'))
79
80 # number of lines greater than 50
81 self.text.insert('end', self.text.get('1.0', 'end')*4)
82 p = self.get_parser('54.5')
83
84 def test_is_in_string(self):
85 get = self.get_parser

Callers

nothing calls this directly

Calls 8

get_parserMethod · 0.95
strFunction · 0.85
tag_addMethod · 0.80
assertInMethod · 0.80
assertRaisesMethod · 0.45
assertEqualMethod · 0.45
getMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected