summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/common.py7
-rw-r--r--tests/enum.py10
3 files changed, 15 insertions, 4 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d7ef601..6543375 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -7,7 +7,7 @@ PYTHONPATH = $(top_builddir):$(top_builddir)/gobject:$(top_srcdir):$(top_srcdir)
check-local: $(top_srcdir)/gtk/__init__.py
@if ! test -e $(top_builddir)/gtk/__init__.py; then cp $(top_srcdir)/gtk/__init__.py $(top_builddir)/gtk/__init__.py; fi
- @PYTHONPATH=$(PYTHONPATH) $(PYTHON) $(srcdir)/runtests.py
+ @PYTHONPATH=$(PYTHONPATH) DIST_CHECK=1 $(PYTHON) $(srcdir)/runtests.py
@if test "$(top_builddir)" != "$(top_srcdir)"; then rm -f $(top_builddir)/gtk/__init__.py*; fi
@rm -fr *.pyc
diff --git a/tests/common.py b/tests/common.py
index b5eb774..adf4bcc 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -1,3 +1,10 @@
+import os
+import sys
+
+if not os.environ.has_key('DIST_CHECK'):
+ sys.path.insert(0, '..')
+ sys.path.insert(0, '../gobject')
+
import ltihooks
import gobject
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)