[Tests] Fixes in test_tracker_icons.py
* Removed publicbt.org test as server is down * Replaced ubuntu.ico with ubuntu.png to make the test pass
This commit is contained in:
parent
9d662bf059
commit
bb5f20e3de
|
@ -1,5 +1,7 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
import deluge.component as component
|
import deluge.component as component
|
||||||
import deluge.ui.tracker_icons
|
import deluge.ui.tracker_icons
|
||||||
from deluge.ui.tracker_icons import TrackerIcon, TrackerIcons
|
from deluge.ui.tracker_icons import TrackerIcon, TrackerIcons
|
||||||
|
@ -13,6 +15,7 @@ deluge.ui.tracker_icons.PIL_INSTALLED = False
|
||||||
common.disable_new_release_check()
|
common.disable_new_release_check()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.internet
|
||||||
class TrackerIconsTestCase(BaseTestCase):
|
class TrackerIconsTestCase(BaseTestCase):
|
||||||
|
|
||||||
def set_up(self):
|
def set_up(self):
|
||||||
|
@ -48,7 +51,7 @@ class TrackerIconsTestCase(BaseTestCase):
|
||||||
|
|
||||||
def test_get_ubuntu_ico(self):
|
def test_get_ubuntu_ico(self):
|
||||||
# ubuntu.com has inline css which causes HTMLParser issues
|
# ubuntu.com has inline css which causes HTMLParser issues
|
||||||
icon = TrackerIcon(os.path.join(dirname, "ubuntu.ico"))
|
icon = TrackerIcon(os.path.join(dirname, "ubuntu.png"))
|
||||||
d = self.icons.fetch("www.ubuntu.com")
|
d = self.icons.fetch("www.ubuntu.com")
|
||||||
d.addCallback(self.assertNotIdentical, None)
|
d.addCallback(self.assertNotIdentical, None)
|
||||||
d.addCallback(self.assertEquals, icon)
|
d.addCallback(self.assertEquals, icon)
|
||||||
|
@ -62,13 +65,6 @@ class TrackerIconsTestCase(BaseTestCase):
|
||||||
d.addCallback(self.assertEquals, icon)
|
d.addCallback(self.assertEquals, icon)
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def test_get_publicbt_ico(self):
|
|
||||||
icon = TrackerIcon(os.path.join(dirname, "publicbt.ico"))
|
|
||||||
d = self.icons.fetch("publicbt.org")
|
|
||||||
d.addCallback(self.assertNotIdentical, None)
|
|
||||||
d.addCallback(self.assertEquals, icon)
|
|
||||||
return d
|
|
||||||
|
|
||||||
def test_get_empty_string_tracker(self):
|
def test_get_empty_string_tracker(self):
|
||||||
d = self.icons.fetch("")
|
d = self.icons.fetch("")
|
||||||
d.addCallback(self.assertIdentical, None)
|
d.addCallback(self.assertIdentical, None)
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
Loading…
Reference in New Issue