From 50cfd9c9b119480240900004496b6b11ff136e71 Mon Sep 17 00:00:00 2001 From: John Garland Date: Thu, 6 May 2010 23:06:53 +1000 Subject: [PATCH] Update tests --- tests/test_core.py | 2 +- tests/test_tracker_icons.py | 13 +++++++------ tests/ubuntu.png | Bin 850 -> 0 bytes 3 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 tests/ubuntu.png diff --git a/tests/test_core.py b/tests/test_core.py index 7bedef453..748b9f673 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -61,7 +61,7 @@ class CoreTestCase(unittest.TestCase): d.addCallbacks(self.fail, self.assertIsInstance, errbackArgs=(Failure,)) d = self.core.add_torrent_url(url, options, headers) - d.addCallback(self.assertEquals, info_hash) + d.addCallbacks(self.assertEquals, self.fail, callbackArgs=(info_hash,)) return d diff --git a/tests/test_tracker_icons.py b/tests/test_tracker_icons.py index 5ff7241e6..8732ad56e 100644 --- a/tests/test_tracker_icons.py +++ b/tests/test_tracker_icons.py @@ -1,10 +1,6 @@ from twisted.trial import unittest from deluge.ui.tracker_icons import TrackerIcons, TrackerIcon -from deluge.log import setupLogger - -# Must come before import common -setupLogger("debug", "debug.log") import common @@ -38,11 +34,16 @@ class TrackerIconsTestCase(unittest.TestCase): return d def test_get_ubuntu_ico(self): + def check_data(icon, data): + self.assertNotEqual(icon.get_data(), data) + # ubuntu.com has inline css which causes HTMLParser issues - icon = TrackerIcon("../ubuntu.png") d = icons.get("www.ubuntu.com") d.addCallback(self.assertNotIdentical, None) - d.addCallback(self.assertEquals, icon) + # as ubuntu's icon is 32x32 it may get resized and hence + # we can't test if the icon is equal to a reference one + # however we can test that the icon has some sort of data + d.addCallback(check_data, "") return d def test_get_openbt_png(self): diff --git a/tests/ubuntu.png b/tests/ubuntu.png deleted file mode 100644 index 7353cfbd4464f05642fa8cc9072ed00ddb04acd7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 850 zcmV-Y1FigtP)6Q!WcC(ipD33Zv_=!7!%_I6T!$(g_cU&dt3mDM$ht`?>xSI-vPb|BG8vP z04Q+kp5Kcym*$vGb2LsF4H5*h80^r9#{1N?xdld1oZ)VL5^LL`%bg*2ba5!2Jh~u^ zm0&~w(8mEZ+??)K)u|ck*dwdQT+s}X4VQxYLp_b%S0f&Hfkd1q1IPo=4uHhSW@aGA zubWpJN-rp;y{5i7e9i(P{PI07o1U`#q+hxB^Rwu&2DX|B=mv(V3IQP{sj4J8yREp9 zZ&mZ1-6fCxE?E-_+BRpK%El$%IU272lJWfM)<9SE&z$~6#r8S?kOJZ(|H?_JdE7FK zt>&4@Z9k4{2Vp7z;jobnfMObA#*^Q&x_ECsU->D$LlC@z05NBx5jwjry>a>&s=e6O zdo$LT5S#XQ?h{0hbd{{=AiuY(WQ7N;maS*rZhsSw5Bg0d*YA?$76VHCGSAMuLPvQ( z$Lu|q-<(J{wc>cfYI7QL;B6#9L_jpo&?Siz?UB8=9t|MQNP8Etx&c7^bF=?^Z}(uL zsU!A(PNtEc;nUO@{w)N3W~d@VXfLKXTe-sIYlSJj0;n005CEVlq#fT8ogdd-4V4T4UI6;iD$m-c?Zr=Pr==YRFyX5gj1DneB>)x!*3jpM07L;i c1dsrL54cATW96g=$p8QV07*qoM6N<$g6)%yZU6uP