[Python-checkins] cpython (3.4): Issue #6167: Backported tests for Scrollbar.activate() and Scrollbar.set()

serhiy.storchaka python-checkins at python.org
Wed Jul 23 21:18:30 CEST 2014


http://hg.python.org/cpython/rev/2cac1e3f825a
changeset:   91793:2cac1e3f825a
branch:      3.4
parent:      91783:4f9f7e0fe1fd
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Wed Jul 23 22:08:45 2014 +0300
summary:
  Issue #6167: Backported tests for Scrollbar.activate() and Scrollbar.set()
from 6ae34a948cb4.

files:
  Lib/tkinter/test/test_tkinter/test_widgets.py |  18 ++++++++++
  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
--- a/Lib/tkinter/test/test_tkinter/test_widgets.py
+++ b/Lib/tkinter/test/test_tkinter/test_widgets.py
@@ -916,6 +916,24 @@
         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):

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list