diff options
| -rw-r--r-- | ChangeLog | 7 | ||||
| -rw-r--r-- | gio/gio-types.defs | 33 | ||||
| -rw-r--r-- | tests/test_gio.py | 13 |
3 files changed, 35 insertions, 18 deletions
@@ -1,3 +1,10 @@ +2008-06-17 Johan Dahlin <jdahlin@async.com.br> + + * gio/gio-types.defs: + * tests/test_gio.py: + Sort out confusion between interfaces and objects, add test. + Fixes #538601 + 2008-06-09 Paul Pogonyshev <pogonyshev@gmx.net> * gobject/pygobject.c (pygobject_copy, pygobject_deepcopy): New diff --git a/gio/gio-types.defs b/gio/gio-types.defs index fa80816..9b4b74c 100644 --- a/gio/gio-types.defs +++ b/gio/gio-types.defs @@ -14,8 +14,14 @@ (gtype-id "G_TYPE_ASYNC_RESULT") ) +(define-interface Drive + (in-module "gio") + (c-name "GDrive") + (gtype-id "G_TYPE_DRIVE") +) + (define-interface File - (docstring + (docstring "File(arg, path=None, uri=None) -> gio.File subclass\n" "\n" "If arg is specified; creates a GFile with the given argument from the\n" @@ -36,14 +42,7 @@ (gtype-id "G_TYPE_ICON") ) -(define-object ThemedIcon - (in-module "gio") - (c-name "GThemedIcon") - (gtype-id "G_TYPE_THEMED_ICON") - (implements "GIcon") -) - -(define-object LoadableIcon +(define-interface LoadableIcon (in-module "gio") (c-name "GLoadableIcon") (gtype-id "G_TYPE_LOADABLE_ICON") @@ -84,12 +83,6 @@ (gtype-id "G_TYPE_CANCELLABLE") ) -(define-object Drive - (in-module "gio") - (c-name "GDrive") - (gtype-id "G_TYPE_DRIVE") -) - (define-object FileEnumerator (in-module "gio") (parent "GObject") @@ -199,7 +192,7 @@ (in-module "gio") (parent "GObject") (c-name "GSimpleAsyncResult") - (gtype-id "G_TYPE_SIMPLE_ASYNC_RESULT") + (gtype-id "G_TYPE_SIMPLE_ASYNC_RESULT") ) (define-object Vfs @@ -223,6 +216,14 @@ (gtype-id "G_TYPE_NATIVE_VOLUME_MONITOR") ) +(define-object ThemedIcon + (in-module "gio") + (parent "GObject") + (c-name "GThemedIcon") + (gtype-id "G_TYPE_THEMED_ICON") + (implements "GIcon") +) + ;; Enumerations and flags ... (define-flags AppInfoCreateFlags diff --git a/tests/test_gio.py b/tests/test_gio.py index e7387f1..a21eba7 100644 --- a/tests/test_gio.py +++ b/tests/test_gio.py @@ -235,7 +235,16 @@ class TestVolumeMonitor(unittest.TestCase): def testGetMounts(self): mounts = self.monitor.get_mounts() self.failUnless(isinstance(mounts, list)) - + if not mounts: + return + + self.failUnless(isinstance(mounts[0], gio.Mount)) + # Bug 538601 + icon = mounts[0].get_icon() + if not icon: + return + self.failUnless(isinstance(icon, gio.Icon)) + class TestThemedIcon(unittest.TestCase): def setUp(self): @@ -280,4 +289,4 @@ class TestAppInfo(unittest.TestCase): def testSimple(self): self.assertEquals(self.appinfo.get_description(), - "Custom definition for (null)") + "Custom definition for does-not-exist") |
