summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaul Pogonyshev <pogonyshev@gmx.net>2008-08-10 15:53:51 +0000
committerPaul Pogonyshev <paulp@src.gnome.org>2008-08-10 15:53:51 +0000
commit41194973be3d0974521c86f18affa4e53904f10e (patch)
tree2e81b3506428a0a50def1969e6ecac43562a637a /tests
parent586416907139045a8a55b4577270bad91960bca8 (diff)
downloadpygobject-41194973be3d0974521c86f18affa4e53904f10e.tar.gz
pygobject-41194973be3d0974521c86f18affa4e53904f10e.tar.xz
pygobject-41194973be3d0974521c86f18affa4e53904f10e.zip
Bug 546120 – make gio.File more Pythonic
2008-08-10 Paul Pogonyshev <pogonyshev@gmx.net> Bug 546120 – make gio.File more Pythonic * gio/gfile.override (_wrap_g_file_tp_richcompare) (_wrap_g_file_tp_hash, _wrap_g_file_tp_repr): New functions. * tests/test_gio.py (TestFile.test_eq, TestFile.test_hash): New tests. svn path=/trunk/; revision=939
Diffstat (limited to 'tests')
-rw-r--r--tests/test_gio.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/test_gio.py b/tests/test_gio.py
index 8244852..d5b92b3 100644
--- a/tests/test_gio.py
+++ b/tests/test_gio.py
@@ -413,7 +413,16 @@ class TestFile(unittest.TestCase):
loop = glib.MainLoop()
loop.run()
-
+ def test_eq(self):
+ self.assertEqual(gio.File('foo'),
+ gio.File('foo'))
+ self.assertNotEqual(gio.File('foo'),
+ gio.File('bar'))
+
+ def test_hash(self):
+ self.assertEquals(hash(gio.File('foo')),
+ hash(gio.File('foo')))
+
class TestGFileEnumerator(unittest.TestCase):
def setUp(self):