From 41194973be3d0974521c86f18affa4e53904f10e Mon Sep 17 00:00:00 2001 From: Paul Pogonyshev Date: Sun, 10 Aug 2008 15:53:51 +0000 Subject: Bug 546120 – make gio.File more Pythonic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2008-08-10 Paul Pogonyshev 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 --- tests/test_gio.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests') 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): -- cgit