1"Test debugger_r, coverage 30%." 2 3from idlelib import debugger_r 4import unittest 5from test.support import requires 6from tkinter import Tk 7 8 9class Test(unittest.TestCase): 10 11## @classmethod 12## def setUpClass(cls): 13## requires('gui') 14## cls.root = Tk() 15## 16## @classmethod 17## def tearDownClass(cls): 18## cls.root.destroy() 19## del cls.root 20 21 def test_init(self): 22 self.assertTrue(True) # Get coverage of import 23 24 25# Classes GUIProxy, IdbAdapter, FrameProxy, CodeProxy, DictProxy, 26# GUIAdapter, IdbProxy plus 7 module functions. 27 28class IdbAdapterTest(unittest.TestCase): 29 30 def test_dict_item_noattr(self): # Issue 33065. 31 32 class BinData: 33 def __repr__(self): 34 return self.length 35 36 debugger_r.dicttable[0] = {'BinData': BinData()} 37 idb = debugger_r.IdbAdapter(None) 38 self.assertTrue(idb.dict_item(0, 'BinData')) 39 debugger_r.dicttable.clear() 40 41 42if __name__ == '__main__': 43 unittest.main(verbosity=2) 44