Update tests

This commit is contained in:
John Garland 2010-05-06 23:06:53 +10:00
parent 369b03bffb
commit 50cfd9c9b1
3 changed files with 8 additions and 7 deletions

View File

@ -61,7 +61,7 @@ class CoreTestCase(unittest.TestCase):
d.addCallbacks(self.fail, self.assertIsInstance, errbackArgs=(Failure,)) d.addCallbacks(self.fail, self.assertIsInstance, errbackArgs=(Failure,))
d = self.core.add_torrent_url(url, options, headers) 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 return d

View File

@ -1,10 +1,6 @@
from twisted.trial import unittest from twisted.trial import unittest
from deluge.ui.tracker_icons import TrackerIcons, TrackerIcon from deluge.ui.tracker_icons import TrackerIcons, TrackerIcon
from deluge.log import setupLogger
# Must come before import common
setupLogger("debug", "debug.log")
import common import common
@ -38,11 +34,16 @@ class TrackerIconsTestCase(unittest.TestCase):
return d return d
def test_get_ubuntu_ico(self): 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 # ubuntu.com has inline css which causes HTMLParser issues
icon = TrackerIcon("../ubuntu.png")
d = icons.get("www.ubuntu.com") d = icons.get("www.ubuntu.com")
d.addCallback(self.assertNotIdentical, None) 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 return d
def test_get_openbt_png(self): def test_get_openbt_png(self):

Binary file not shown.

Before

Width:  |  Height:  |  Size: 850 B