diff --git a/deluge/tests/google.ico b/deluge/tests/google.ico new file mode 100644 index 000000000..f594697d2 Binary files /dev/null and b/deluge/tests/google.ico differ diff --git a/deluge/tests/google.png b/deluge/tests/google.png deleted file mode 100644 index 553ad65ba..000000000 Binary files a/deluge/tests/google.png and /dev/null differ diff --git a/deluge/tests/test_sessionproxy.py b/deluge/tests/test_sessionproxy.py index d97a4d622..bd1c9c1a1 100644 --- a/deluge/tests/test_sessionproxy.py +++ b/deluge/tests/test_sessionproxy.py @@ -87,6 +87,14 @@ class SessionProxyTestCase(unittest.TestCase): self.sp = deluge.ui.sessionproxy.SessionProxy() client.core.reset() d = self.sp.start() + + def do_get_torrents_status(torrent_ids): + inital_keys = [ + 'queue', 'state', 'name', 'total_wanted', 'progress', 'state', + 'download_payload_rate', 'upload_payload_rate', 'eta', 'owner' + ] + self.sp.get_torrents_status({'id': torrent_ids}, inital_keys) + d.addCallback(do_get_torrents_status) return d def tearDown(self): diff --git a/deluge/tests/test_torrent.py b/deluge/tests/test_torrent.py index f55b4d4e2..381c2bb9a 100644 --- a/deluge/tests/test_torrent.py +++ b/deluge/tests/test_torrent.py @@ -7,8 +7,6 @@ import common from deluge.core.rpcserver import RPCServer from deluge.core.core import Core -deluge.core.torrent.component = test_torrent - from deluge._libtorrent import lt import deluge.component as component @@ -37,6 +35,9 @@ class TorrentTestCase(unittest.TestCase): core_config.save() def setUp(self): + # Save component and set back on teardown + self.original_component = deluge.core.torrent.component + deluge.core.torrent.component = test_torrent self.setup_config() global rpcserver global core @@ -50,6 +51,7 @@ class TorrentTestCase(unittest.TestCase): if self.torrent: self.torrent.prev_status_cleanup_loop.stop() + deluge.core.torrent.component = self.original_component def on_shutdown(result): component._ComponentRegistry.components = {} return component.shutdown().addCallback(on_shutdown) diff --git a/deluge/tests/test_tracker_icons.py b/deluge/tests/test_tracker_icons.py index c671b4f3e..10aa21a8f 100644 --- a/deluge/tests/test_tracker_icons.py +++ b/deluge/tests/test_tracker_icons.py @@ -11,6 +11,9 @@ icons = TrackerIcons() dirname = os.path.dirname(__file__) +import deluge.ui.tracker_icons +deluge.ui.tracker_icons.PIL_INSTALLED = False + class TrackerIconsTestCase(unittest.TestCase): def test_get_deluge_png(self): @@ -24,7 +27,7 @@ class TrackerIconsTestCase(unittest.TestCase): def test_get_google_ico(self): # Google doesn't have any icon links # So instead we'll grab its favicon.ico - icon = TrackerIcon(os.path.join(dirname, "google.png")) + icon = TrackerIcon(os.path.join(dirname, "google.ico")) d = icons.get("www.google.com") d.addCallback(self.assertNotIdentical, None) d.addCallback(self.assertEquals, icon) @@ -32,7 +35,7 @@ class TrackerIconsTestCase(unittest.TestCase): def test_get_google_ico_with_redirect(self): # google.com redirects to www.google.com - icon = TrackerIcon(os.path.join(dirname, "google.png")) + icon = TrackerIcon(os.path.join(dirname, "google.ico")) d = icons.get("google.com") d.addCallback(self.assertNotIdentical, None) d.addCallback(self.assertEquals, icon) diff --git a/deluge/ui/sessionproxy.py b/deluge/ui/sessionproxy.py index 0b5234704..652ebbf87 100644 --- a/deluge/ui/sessionproxy.py +++ b/deluge/ui/sessionproxy.py @@ -76,6 +76,7 @@ class SessionProxy(component.Component): # so that upcoming queries or status updates don't throw errors. self.torrents.setdefault(torrent_id, [time.time(), {}]) self.cache_times.setdefault(torrent_id, {}) + return torrent_ids return client.core.get_session_state().addCallback(on_get_session_state) def stop(self):