summaryrefslogtreecommitdiffstats
path: root/tests/conversion.py
diff options
context:
space:
mode:
authorJohan Dahlin <johan@src.gnome.org>2005-03-16 13:49:10 +0000
committerJohan Dahlin <johan@src.gnome.org>2005-03-16 13:49:10 +0000
commit33039b3716cd62744af5d11992a9b22bcb45ce32 (patch)
treed0ad1c0a0edc9eb12ba80f0201ee6313c0842454 /tests/conversion.py
parent8df9133eb9600278e5be6c9dc5906608c081e129 (diff)
downloadpygobject-33039b3716cd62744af5d11992a9b22bcb45ce32.tar.gz
pygobject-33039b3716cd62744af5d11992a9b22bcb45ce32.tar.xz
pygobject-33039b3716cd62744af5d11992a9b22bcb45ce32.zip
New test.
* tests/test_radiobutton.py (RadioButtonTest): New test. * tests: Renamed *.py to test_*.py
Diffstat (limited to 'tests/conversion.py')
-rw-r--r--tests/conversion.py59
1 files changed, 0 insertions, 59 deletions
diff --git a/tests/conversion.py b/tests/conversion.py
deleted file mode 100644
index e621e1f..0000000
--- a/tests/conversion.py
+++ /dev/null
@@ -1,59 +0,0 @@
-# -*- Mode: Python -*-
-
-import unittest
-
-from common import gtk
-
-class Tests(unittest.TestCase):
-
- def testUnicharArg(self):
- """ Test unichar values when used as arguments. """
-
- entry = gtk.Entry()
- for valid_value in ['a', u'b', u'\ufff0', u'\ufff0'.encode()]:
- entry.set_invisible_char(valid_value)
- assert entry.get_invisible_char() == unicode(valid_value)
-
- for invalid_value in ['12', None, 1, '']:
- try:
- entry.set_invisible_char(invalid_value)
- except:
- pass
- else:
- raise AssertionError('exception not raised on invalid value w/ set_invisible_char: %s'
- % invalid_value)
-
- def testUnicharProperty(self):
- """ Test unichar values when used as properties. """
-
- entry = gtk.Entry()
- for valid_value in ['a', u'b', u'\ufff0', u'\ufff0'.encode()]:
- entry.set_property('invisible_char', valid_value)
- assert entry.get_property('invisible_char') == valid_value
-
- for invalid_value in ['12', None, 1, '']:
- try:
- entry.set_property('invisible_char', invalid_value)
- except:
- pass
- else:
- raise AssertionError('exception not raised on invalid value w/ set_property: %s'
- % invalid_value)
-
- def testColorCreation(self):
- """ Test GdkColor creation """
-
- c = gtk.gdk.Color(1, 2, 3)
- assert c.red == 1 and c.green == 2 and c.blue == 3
-
- c = gtk.gdk.Color(pixel = 0xffff)
- assert c.pixel == 0xffff
-
- c = gtk.gdk.Color(pixel = 0xffffL)
- assert c.pixel == 0xffff
-
- c = gtk.gdk.Color(pixel = 0xffffffffL)
- assert c.pixel == 0xffffffffL
-
-if __name__ == '__main__':
- unittest.main()