| 1 |
"Test calltip_w, coverage 18%." |
| 2 |
|
| 3 |
from idlelib import calltip_w |
| 4 |
import unittest |
| 5 |
from test.support import requires |
| 6 |
from tkinter import Tk, Text |
| 7 |
|
| 8 |
|
| 9 |
class CallTipWindowTest(unittest.TestCase): |
| 10 |
|
| 11 |
@classmethod |
| 12 |
def setUpClass(cls): |
| 13 |
requires('gui') |
| 14 |
cls.root = Tk() |
| 15 |
cls.root.withdraw() |
| 16 |
cls.text = Text(cls.root) |
| 17 |
cls.calltip = calltip_w.CalltipWindow(cls.text) |
| 18 |
|
| 19 |
@classmethod |
| 20 |
def tearDownClass(cls): |
| 21 |
cls.root.update_idletasks() |
| 22 |
cls.root.destroy() |
| 23 |
del cls.text, cls.root |
| 24 |
|
| 25 |
def test_init(self): |
| 26 |
self.assertEqual(self.calltip.anchor_widget, self.text) |
| 27 |
|
| 28 |
if __name__ == '__main__': |
| 29 |
unittest.main(verbosity=2) |