testinggtk r130 - trunk/tests/pango



Author: bjornl
Date: Sun Jun 15 03:50:09 2008
New Revision: 130
URL: http://svn.gnome.org/viewvc/testinggtk?rev=130&view=rev

Log:
Tests for the pango.Context class

Added:
   trunk/tests/pango/test_context.py

Added: trunk/tests/pango/test_context.py
==============================================================================
--- (empty file)
+++ trunk/tests/pango/test_context.py	Sun Jun 15 03:50:09 2008
@@ -0,0 +1,19 @@
+'''
+Tests for the ``pango.Context`` class.
+'''
+import gtk
+import pango
+
+def test_widget_default_attributes():
+    '''
+    Tests the default attributes of a ``pango.Context`` created from a
+    ``gtk.Widget`` using ``create_pango_context``.
+    '''
+    ctx = gtk.Label().create_pango_context()
+    assert ctx.get_base_dir() == pango.DIRECTION_LTR
+    lang = ctx.get_language()
+    # yeah..
+    assert lang.to_string() == 'sv-se'
+    fd = ctx.get_font_description()
+    assert fd.get_family() == 'Verdana'
+    assert fd.get_size() / pango.SCALE == 10



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]