Module: deluge
Branch: master
Commit: 50cfd9c9b119480240900004496b6b11ff136e71

Author: John Garland <[email protected]>
Date:   Thu May  6 23:06:53 2010 +1000

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(-)

diff --git a/tests/test_core.py b/tests/test_core.py
index 7bedef4..748b9f6 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 5ff7241..8732ad5 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 7353cfb..0000000
Binary files a/tests/ubuntu.png and /dev/null differ

-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to