summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-07-23 19:08:45 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-07-23 19:08:45 (GMT)
commit1ce228934206c5019eeef196d2196e0e07cd0751 (patch)
tree9ea40075b2cd3c0033c671a6fd70c94a9f571de8 /Lib/tkinter
parentf012ba42fe54253378a2784aaf7177aa36be579a (diff)
downloadcpython-1ce228934206c5019eeef196d2196e0e07cd0751.zip
cpython-1ce228934206c5019eeef196d2196e0e07cd0751.tar.gz
cpython-1ce228934206c5019eeef196d2196e0e07cd0751.tar.bz2
Issue #6167: Backported tests for Scrollbar.activate() and Scrollbar.set()
from 6ae34a948cb4.
Diffstat (limited to 'Lib/tkinter')
-rw-r--r--Lib/tkinter/test/test_tkinter/test_widgets.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/tkinter/test/test_tkinter/test_widgets.py b/Lib/tkinter/test/test_tkinter/test_widgets.py
index 310fa92..c902997 100644
--- a/Lib/tkinter/test/test_tkinter/test_widgets.py
+++ b/Lib/tkinter/test/test_tkinter/test_widgets.py
@@ -916,6 +916,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):