summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSVN-Git Migration <python-modules-team@lists.alioth.debian.org>2015-10-08 09:28:12 -0700
committerSVN-Git Migration <python-modules-team@lists.alioth.debian.org>2015-10-08 09:28:12 -0700
commit2b97378660a8b1d5c0407d769e6ad1d696562e94 (patch)
treefe956cbc16eeb043c2f024e74605dbffb2d30785 /tests
parent78ab76471e9cecf4f13c56ac87db544cda7ee48b (diff)
Imported Upstream version 1.9.19
Diffstat (limited to 'tests')
-rw-r--r--tests/test_Scale.py15
-rw-r--r--tests/test_proxy.py18
-rw-r--r--tests/test_utils.py12
3 files changed, 45 insertions, 0 deletions
diff --git a/tests/test_Scale.py b/tests/test_Scale.py
new file mode 100644
index 0000000..7750d77
--- /dev/null
+++ b/tests/test_Scale.py
@@ -0,0 +1,15 @@
+#!/usr/bin/env python
+import unittest
+
+from kiwi.ui.widgets.scale import ProxyHScale, ProxyVScale
+
+class ScaleTest(unittest.TestCase):
+ def testFloat(self):
+ vscale = ProxyVScale()
+ self.assertEqual(vscale.get_property("data-type"), float)
+
+ hscale = ProxyHScale()
+ self.assertEqual(hscale.get_property("data-type"), float)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/tests/test_proxy.py b/tests/test_proxy.py
index 6d70c85..a162e26 100644
--- a/tests/test_proxy.py
+++ b/tests/test_proxy.py
@@ -13,6 +13,7 @@ from kiwi.ui.widgets.checkbutton import ProxyCheckButton
from kiwi.ui.widgets.entry import ProxyEntry
from kiwi.ui.widgets.label import ProxyLabel
from kiwi.ui.widgets.radiobutton import ProxyRadioButton
+from kiwi.ui.widgets.scale import ProxyHScale, ProxyVScale
from kiwi.ui.widgets.spinbutton import ProxySpinButton
from kiwi.ui.widgets.textview import ProxyTextView
from kiwi.ui.widgets.combo import ProxyComboEntry, ProxyComboBox
@@ -45,6 +46,8 @@ class Model(Settable):
radiobutton='first',
label='label',
spinbutton=100,
+ hscale=100.0,
+ vscale=100.0,
textview='sliff',
comboentry='CE1',
combobox='CB1',
@@ -57,6 +60,8 @@ class TestProxy(unittest.TestCase):
self.view.add('entry', str, ProxyEntry)
self.view.add('label', str, ProxyLabel)
self.view.add('spinbutton', int, ProxySpinButton)
+ self.view.add('hscale', float, ProxyHScale)
+ self.view.add('vscale', float, ProxyVScale)
self.view.add('button', str, ProxyButton)
self.view.add('buttonpixbuf', gdk.Pixbuf, ProxyButton)
@@ -67,6 +72,9 @@ class TestProxy(unittest.TestCase):
self.radio_second.set_group(self.radio_first)
self.radio_second.set_property('data_value', 'second')
+ self.view.hscale.get_adjustment().upper = 200
+ self.view.vscale.get_adjustment().upper = 250
+
self.comboentry = self.view.add('comboentry', str, ProxyComboEntry)
self.comboentry.prefill(['CE1','CE2','CE3'])
self.comboentry.show()
@@ -100,6 +108,16 @@ class TestProxy(unittest.TestCase):
self.radio_first.set_active(True)
self.assertEqual(self.model.radiobutton, 'first')
+ def testHScale(self):
+ self.assertEqual(self.model.vscale, 100)
+ self.view.vscale.set_value(220)
+ self.assertEqual(self.model.vscale, 220)
+
+ def testVScale(self):
+ self.assertEqual(self.model.vscale, 100)
+ self.view.vscale.set_value(200)
+ self.assertEqual(self.model.vscale, 200)
+
def testSpinButton(self):
self.assertEqual(self.model.spinbutton, 100)
self.view.spinbutton.set_text("200")
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 362bd6c..d734f09 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -57,6 +57,18 @@ class MixinTest(unittest.TestCase):
self.failUnless(hasattr(o, 'mixin_prop'))
self.assertEqual(o.mixin_prop, 'foo')
+ def testHScale(self):
+ from kiwi.ui.widgets.scale import ProxyHScale
+ s = ProxyHScale()
+ self.failUnless(hasattr(s, 'data_type'))
+ self.assertEqual(s.data_type, float)
+
+ def testVScale(self):
+ from kiwi.ui.widgets.scale import ProxyVScale
+ s = ProxyVScale()
+ self.failUnless(hasattr(s, 'data_type'))
+ self.assertEqual(s.data_type, float)
+
def testSpinButton(self):
from kiwi.ui.widgets.spinbutton import ProxySpinButton
s = ProxySpinButton()