diff options
author | Paul Pogonyshev <pogonyshev@gmx.net> | 2009-01-14 18:39:45 +0000 |
---|---|---|
committer | Paul Pogonyshev <paulp@src.gnome.org> | 2009-01-14 18:39:45 +0000 |
commit | 971c49ae3eec639d9472b3b2ee03713da1ef041c (patch) | |
tree | 2ee6880f229dfaa2e9538d283ae82954c0eb3a66 /tests | |
parent | b5cf45145e8f0f62511aa072c0768612426455f1 (diff) | |
download | pygobject-971c49ae3eec639d9472b3b2ee03713da1ef041c.tar.gz |
Bug 566706 – cleanup GIO overrides
2009-01-14 Paul Pogonyshev <pogonyshev@gmx.net>
Bug 566706 – cleanup GIO overrides
* gio/gio.override (pygio_notify_new)
(pygio_notify_using_optional_callback)
(pygio_notify_callback_is_valid_full)
(pygio_notify_callback_is_valid)
(pygio_notify_reference_callback): New functions.
(pygio_notify_free): Rename from pygio_free_notify() and extend.
(async_result_callback_marshal): Warn if new `referenced' field is
not set (programming error).
(_wrap_g_drive_eject, _wrap_g_drive_poll_for_media)
(_wrap_g_mount_unmount, _wrap_g_mount_eject)
(_wrap_g_mount_remount): Lots of cleanup: use new functions
instead of repeating code, unify and fix error handling.
* gio/gfile.override (_wrap_g_file_read_async)
(_wrap_g_file_load_contents_async)
(_wrap_g_file_enumerate_children_async)
(_wrap_g_file_mount_mountable, _wrap_g_file_unmount_mountable)
(_wrap_g_file_mount_enclosing_volume, _wrap_g_file_copy)
(_wrap_g_file_copy_async, _wrap_g_file_move)
(_wrap_g_file_append_to_async, _wrap_g_file_create_async)
(_wrap_g_file_replace_async, _wrap_g_file_query_info_async)
(_wrap_g_file_replace_contents_async): Similar cleanup.
* gio/gfileenumerator.override
(_wrap_g_file_enumerator_next_files_async): Similar cleanup.
* gio/gicon.override (_wrap_g_loadable_icon_load_async): Similar
cleanup.
* gio/ginputstream.override (_wrap_g_input_stream_close_async):
Similar cleanup.
* gio/goutputstream.override (_wrap_g_output_stream_write_async)
(_wrap_g_output_stream_close_async): Similar cleanup.
* gio/gvolume.override (_wrap_g_volume_mount)
(_wrap_g_volume_eject): Similar cleanup.
* tests/test_gio.py (TestFile.test_copy_async): Fix the test.
svn path=/trunk/; revision=996
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_gio.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/test_gio.py b/tests/test_gio.py index 10ef6ac7..ba05f83d 100644 --- a/tests/test_gio.py +++ b/tests/test_gio.py @@ -303,8 +303,11 @@ class TestFile(unittest.TestCase): destination = gio.File('copy.txt') def copied(source_, result): - self.assert_(source_ is source) - self.failUnless(source_.copy_finish(result)) + try: + self.assert_(source_ is source) + self.failUnless(source_.copy_finish(result)) + finally: + loop.quit() def progress(current, total): self.assert_(isinstance(current, long)) @@ -312,7 +315,9 @@ class TestFile(unittest.TestCase): self.assert_(0 <= current <= total) try: + loop = glib.MainLoop() source.copy_async(destination, copied, progress_callback = progress) + loop.run() self.failUnless(os.path.exists('copy.txt')) self.assertEqual(open('file.txt').read(), |