testinggtk r274 - trunk/tests/gdk
- From: bjornl svn gnome org
- To: svn-commits-list gnome org
- Subject: testinggtk r274 - trunk/tests/gdk
- Date: Sat, 28 Jun 2008 09:13:02 +0000 (UTC)
Author: bjornl
Date: Sat Jun 28 09:13:02 2008
New Revision: 274
URL: http://svn.gnome.org/viewvc/testinggtk?rev=274&view=rev
Log:
Tests for window position and get pointer
Modified:
trunk/tests/gdk/test_window.py
Modified: trunk/tests/gdk/test_window.py
==============================================================================
--- trunk/tests/gdk/test_window.py (original)
+++ trunk/tests/gdk/test_window.py Sat Jun 28 09:13:02 2008
@@ -15,3 +15,58 @@
display = gdk.display_get_default()
window = gdk.window_foreign_new_for_display(display, 0)
assert not window
+
+def test_get_constructor_specified_position():
+ '''
+ Ensure that the position is correct after the ``gdk.Window`` has
+ been created.
+ '''
+ window = gdk.Window(None,
+ 100, 100,
+ gdk.WINDOW_TOPLEVEL,
+ 0,
+ gdk.INPUT_OUTPUT,
+ x = 100, y = 100)
+ assert window.get_position() == (100, 100)
+
+def test_set_get_position_unrealized():
+ '''
+ Test getting and setting the position of a top level unrealized
+ window.
+ '''
+ window = gdk.Window(None,
+ 100, 100,
+ gdk.WINDOW_TOPLEVEL,
+ 0,
+ gdk.INPUT_OUTPUT)
+ window.move(300, 300)
+ assert window.get_position() == (300, 300)
+
+def test_move_unrealized_override_redirect_window():
+ '''
+ Ensure that moving an unrealized override redirect window updates
+ that windows position.
+ '''
+ window = gdk.Window(None,
+ 100, 100,
+ gdk.WINDOW_TOPLEVEL,
+ 0,
+ gdk.INPUT_OUTPUT)
+ window.set_override_redirect(True)
+ window.move(300, 300)
+ assert window.get_position() == (300, 300)
+
+def test_get_pointer_unrealized():
+ '''
+ Ensure that ``get_pointer`` returns a three tuple where the first
+ two elements are integers and the third is a GDK modifier mask.
+ '''
+ window = gdk.Window(None,
+ 100, 100,
+ gdk.WINDOW_TOPLEVEL,
+ 0,
+ gdk.INPUT_OUTPUT)
+ x, y, modifier = window.get_pointer()
+ assert isinstance(x, int)
+ assert isinstance(y, int)
+ assert isinstance(modifier, gdk.ModifierType)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]