summaryrefslogtreecommitdiffstats
path: root/tests/enum.py
diff options
context:
space:
mode:
authorJohan Dahlin <johan@src.gnome.org>2004-07-19 11:29:13 +0000
committerJohan Dahlin <johan@src.gnome.org>2004-07-19 11:29:13 +0000
commitc2d430551d355245c74e8b30ca4796e772f42275 (patch)
tree501c7dd5ef8a0176a3781a7c600c431704f5961b /tests/enum.py
parentcfa02147247fa59b82eff91e2058d1488ff438e3 (diff)
downloadpygobject-c2d430551d355245c74e8b30ca4796e772f42275.tar.gz
pygobject-c2d430551d355245c74e8b30ca4796e772f42275.tar.xz
pygobject-c2d430551d355245c74e8b30ca4796e772f42275.zip
Fix, a window is really WITHDRAWN if it's not SHOWN and not ICONIFIED...
* tests/enum.py (EnumTest.testWindowGetState): Fix, a window is really WITHDRAWN if it's not SHOWN and not ICONIFIED... * tests/common.py: Add .. and ../gobject when distcheck isn't ran * gobject/pygenum.c: Use a dict instead of a tuple for __enum_values__, so we can handle negative enum values (eg: GDK_NOTHING) * gobject/pyflags.c: Ditto for __flag_values__ * gobject/pygparamspec.c (pyg_param_spec_getattr): reference count fixing
Diffstat (limited to 'tests/enum.py')
-rw-r--r--tests/enum.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/enum.py b/tests/enum.py
index ed9b98f..6b4f435 100644
--- a/tests/enum.py
+++ b/tests/enum.py
@@ -28,9 +28,9 @@ class EnumTest(unittest.TestCase):
win.realize()
state = win.window.get_state()
- assert state == gdk.WINDOW_STATE_ICONIFIED
+ assert state == gdk.WINDOW_STATE_WITHDRAWN
assert isinstance(state, gdk.WindowState)
- assert 'WINDOW_STATE_ICONIFIED' in repr(state)
+ assert 'WINDOW_STATE_WITHDRAWN' in repr(state)
def testProperty(self):
win = gtk.Window()
@@ -52,7 +52,11 @@ class EnumTest(unittest.TestCase):
enum = enums[0]
assert hasattr(enum, 'enum_class')
assert issubclass(enum.enum_class, gobject.GEnum)
-
+
+ def testWeirdEnumValues(self):
+ assert int(gdk.NOTHING) == -1
+ assert int(gdk.BUTTON_PRESS) == 4
+
class FlagsTest(unittest.TestCase):
def testFlags(self):
assert issubclass(gobject.GFlags, int)