summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaul Pogonyshev <pogonyshev@gmx.net>2008-08-09 15:09:42 +0000
committerPaul Pogonyshev <paulp@src.gnome.org>2008-08-09 15:09:42 +0000
commit38848aaa4ffecf6cccf576df496d41f4ce984579 (patch)
tree6b7ae2b9ec6154fadf1319edd023bf70f3d7ed0f /tests
parent2a778d5bc55e812d549c02266d42b3f454627bd5 (diff)
downloadpygobject-38848aaa4ffecf6cccf576df496d41f4ce984579.tar.gz
pygobject-38848aaa4ffecf6cccf576df496d41f4ce984579.tar.xz
pygobject-38848aaa4ffecf6cccf576df496d41f4ce984579.zip
Bug 546135 – GIcon and implementations improvements
2008-08-09 Paul Pogonyshev <pogonyshev@gmx.net> Bug 546135 – GIcon and implementations improvements * gio/gio.defs (g_file_icon_new): Change from method of gio.File to constructor of gio.FileIcon. * tests/test_gicon.py (TestIcon.test_eq, Test_Eq.test_hash) (TestLoadableIcon.setUp): Adapt accordingly. (TestFileIcon): New test case. svn path=/trunk/; revision=933
Diffstat (limited to 'tests')
-rw-r--r--tests/test_gicon.py21
1 files changed, 13 insertions, 8 deletions
diff --git a/tests/test_gicon.py b/tests/test_gicon.py
index 0a66c9e..b71105d 100644
--- a/tests/test_gicon.py
+++ b/tests/test_gicon.py
@@ -8,21 +8,21 @@ from common import gio, glib
class TestIcon(unittest.TestCase):
def test_eq(self):
- self.assertEquals(gio.File('foo.png').icon_new(),
- gio.File('foo.png').icon_new())
+ self.assertEquals(gio.FileIcon(gio.File('foo.png')),
+ gio.FileIcon(gio.File('foo.png')))
self.assertEquals(gio.ThemedIcon('foo'),
gio.ThemedIcon('foo'))
- self.assertNotEqual(gio.File('foo.png').icon_new(),
- gio.File('bar.png').icon_new())
+ self.assertNotEqual(gio.FileIcon(gio.File('foo.png')),
+ gio.FileIcon(gio.File('bar.png')))
self.assertNotEquals(gio.ThemedIcon('foo'),
gio.ThemedIcon('bar'))
- self.assertNotEquals(gio.File('foo.png').icon_new(),
+ self.assertNotEquals(gio.FileIcon(gio.File('foo.png')),
gio.ThemedIcon('foo'))
def test_hash(self):
- self.assertEquals(hash(gio.File('foo.png').icon_new()),
- hash(gio.File('foo.png').icon_new()))
+ self.assertEquals(hash(gio.FileIcon(gio.File('foo.png'))),
+ hash(gio.FileIcon(gio.File('foo.png'))))
self.assertEquals(hash(gio.ThemedIcon('foo')),
hash(gio.ThemedIcon('foo')))
@@ -35,7 +35,7 @@ class TestLoadableIcon(unittest.TestCase):
'<svg width="32" height="32"/>')
self.file.write(self.svg)
self.file.close()
- self.icon = gio.File('temp.svg').icon_new()
+ self.icon = gio.FileIcon(gio.File('temp.svg'))
def tearDown(self):
if os.path.exists('temp.svg'):
@@ -64,6 +64,11 @@ class TestLoadableIcon(unittest.TestCase):
loop = glib.MainLoop()
loop.run()
+class TestFileIcon(unittest.TestCase):
+ def test_constructor(self):
+ file = gio.File('foo.png')
+ self.assert_(file is gio.FileIcon(file).get_file())
+
class TestThemedIcon(unittest.TestCase):
def setUp(self):
self.icon = gio.ThemedIcon("open")