summaryrefslogtreecommitdiffstats
path: root/Lib/lib-tk
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-07-23 19:06:26 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-07-23 19:06:26 (GMT)
commit9cb68ca92797c6e013b713b26c27637ecf2e6884 (patch)
tree99f89c5079fea7099b6ee05b4cd781650d1ee6d4 /Lib/lib-tk
parentfc1ae6c67358a1937e0bdbefd106d2c1a673182e (diff)
downloadcpython-9cb68ca92797c6e013b713b26c27637ecf2e6884.zip
cpython-9cb68ca92797c6e013b713b26c27637ecf2e6884.tar.gz
cpython-9cb68ca92797c6e013b713b26c27637ecf2e6884.tar.bz2
Issue #6167: Backported tests for Scrollbar.activate() and Scrollbar.set()
from 6ae34a948cb4.
Diffstat (limited to 'Lib/lib-tk')
-rw-r--r--Lib/lib-tk/test/test_tkinter/test_widgets.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/lib-tk/test/test_tkinter/test_widgets.py b/Lib/lib-tk/test/test_tkinter/test_widgets.py
index 3f5f0b9..0ec7187 100644
--- a/Lib/lib-tk/test/test_tkinter/test_widgets.py
+++ b/Lib/lib-tk/test/test_tkinter/test_widgets.py
@@ -913,6 +913,24 @@ class ScrollbarTest(AbstractWidgetTest, unittest.TestCase):
self.checkEnumParam(widget, 'orient', 'vertical', 'horizontal',
errmsg='bad orientation "{}": must be vertical or horizontal')
+ def test_activate(self):
+ sb = self.create()
+ for e in ('arrow1', 'slider', 'arrow2'):
+ sb.activate(e)
+ sb.activate('')
+ self.assertRaises(TypeError, sb.activate)
+ self.assertRaises(TypeError, sb.activate, 'arrow1', 'arrow2')
+
+ def test_set(self):
+ sb = self.create()
+ sb.set(0.2, 0.4)
+ self.assertEqual(sb.get(), (0.2, 0.4))
+ self.assertRaises(TclError, sb.set, 'abc', 'def')
+ self.assertRaises(TclError, sb.set, 0.6, 'def')
+ self.assertRaises(TclError, sb.set, 0.6, None)
+ self.assertRaises(TclError, sb.set, 0.6)
+ self.assertRaises(TclError, sb.set, 0.6, 0.7, 0.8)
+
@add_standard_options(StandardOptionsTests)
class PanedWindowTest(AbstractWidgetTest, unittest.TestCase):