testinggtk r201 - trunk/tests



Author: bjornl
Date: Sat Jun 21 17:02:01 2008
New Revision: 201
URL: http://svn.gnome.org/viewvc/testinggtk?rev=201&view=rev

Log:
Test for getting the icon of a gtk.RecentItem with an unknown mime-type

Modified:
   trunk/tests/test_recentmanager.py

Modified: trunk/tests/test_recentmanager.py
==============================================================================
--- trunk/tests/test_recentmanager.py	(original)
+++ trunk/tests/test_recentmanager.py	Sat Jun 21 17:02:01 2008
@@ -3,7 +3,9 @@
 '''
 import gio
 import gtk
+from gtk import gdk
 import os
+import utils
 
 def test_default_attributes():
     rm = gtk.RecentManager()
@@ -70,3 +72,21 @@
                                  app_exec = 'gedit'))
     recent_info = rm.lookup_item(uri)
     assert recent_info.get_uri() == uri
+
+ utils fail_on_warnings
+def test_recent_info_get_icon_unknown_mime():
+    '''
+    Get the icon for a ``gtk.RecentInfo`` with an unknown mime
+    type. The method should return ``None`` and no warning should be
+    printed.
+
+    :bug: #539470
+    '''
+    rm = gtk.RecentManager()
+    rm.add_full('file:///foo', dict(mime_type = 'foo',
+                                    app_type = 'foo',
+                                    app_name = 'boo',
+                                    app_exec = 'gedit'))
+    recent_info = rm.lookup_item('file:///foo')
+    pixbuf = recent_info.get_icon(48)
+    assert isinstance(pixbuf, gdk.Pixbuf)



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