| 1 |
"Test debugger_r, coverage 30%." |
| 2 |
|
| 3 |
from idlelib import debugger_r |
| 4 |
import unittest |
| 5 |
|
| 6 |
# Boilerplate likely to be needed for future test classes. |
| 7 |
##from test.support import requires |
| 8 |
##from tkinter import Tk |
| 9 |
##class Test(unittest.TestCase): |
| 10 |
## @classmethod |
| 11 |
## def setUpClass(cls): |
| 12 |
## requires('gui') |
| 13 |
## cls.root = Tk() |
| 14 |
## @classmethod |
| 15 |
## def tearDownClass(cls): |
| 16 |
## cls.root.destroy() |
| 17 |
|
| 18 |
# GUIProxy, IdbAdapter, FrameProxy, CodeProxy, DictProxy, |
| 19 |
# GUIAdapter, IdbProxy, and 7 functions still need tests. |
| 20 |
|
| 21 |
class IdbAdapterTest(unittest.TestCase): |
| 22 |
|
| 23 |
def test_dict_item_noattr(self): # Issue 33065. |
| 24 |
|
| 25 |
class BinData: |
| 26 |
def __repr__(self): |
| 27 |
return self.length |
| 28 |
|
| 29 |
debugger_r.dicttable[0] = {'BinData': BinData()} |
| 30 |
idb = debugger_r.IdbAdapter(None) |
| 31 |
self.assertTrue(idb.dict_item(0, 'BinData')) |
| 32 |
debugger_r.dicttable.clear() |
| 33 |
|
| 34 |
|
| 35 |
if __name__ == '__main__': |
| 36 |
unittest.main(verbosity=2) |