mirror of
https://github.com/bunny-lab-io/Borealis.git
synced 2025-07-28 11:08:28 -06:00
Removed the Requirement to Install Python and NodeJS (Now Bundled with Borealis)
This commit is contained in:
49
Dependencies/Python/Lib/idlelib/idle_test/test_multicall.py
vendored
Normal file
49
Dependencies/Python/Lib/idlelib/idle_test/test_multicall.py
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
"Test multicall, coverage 33%."
|
||||
|
||||
from idlelib import multicall
|
||||
import unittest
|
||||
from test.support import requires
|
||||
from test.support.testcase import ExtraAssertions
|
||||
from tkinter import Tk, Text
|
||||
|
||||
|
||||
class MultiCallTest(unittest.TestCase, ExtraAssertions):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
requires('gui')
|
||||
cls.root = Tk()
|
||||
cls.root.withdraw()
|
||||
cls.mc = multicall.MultiCallCreator(Text)
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
del cls.mc
|
||||
cls.root.update_idletasks()
|
||||
## for id in cls.root.tk.call('after', 'info'):
|
||||
## cls.root.after_cancel(id) # Need for EditorWindow.
|
||||
cls.root.destroy()
|
||||
del cls.root
|
||||
|
||||
def test_creator(self):
|
||||
mc = self.mc
|
||||
self.assertIs(multicall._multicall_dict[Text], mc)
|
||||
self.assertIsSubclass(mc, Text)
|
||||
mc2 = multicall.MultiCallCreator(Text)
|
||||
self.assertIs(mc, mc2)
|
||||
|
||||
def test_init(self):
|
||||
mctext = self.mc(self.root)
|
||||
self.assertIsInstance(mctext._MultiCall__binders, list)
|
||||
|
||||
def test_yview(self):
|
||||
# Added for tree.wheel_event
|
||||
# (it depends on yview to not be overridden)
|
||||
mc = self.mc
|
||||
self.assertIs(mc.yview, Text.yview)
|
||||
mctext = self.mc(self.root)
|
||||
self.assertIs(mctext.yview.__func__, Text.yview)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main(verbosity=2)
|
Reference in New Issue
Block a user