Fix and update tests

This commit is contained in:
Calum Lind 2013-05-01 04:13:05 +01:00
parent 4dd6308db9
commit 607be461e0
6 changed files with 11 additions and 4 deletions

View File

@ -43,7 +43,7 @@ deluge.main.start_daemon()
core = Popen([sys.executable], cwd=CWD, stdin=fp, stdout=PIPE, stderr=PIPE)
while True:
line = core.stderr.readline()
if "Factory starting on 58846" in line:
if "starting on 58846" in line:
time.sleep(0.3) # Slight pause just incase
break
elif "Couldn't listen on localhost:58846" in line:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

BIN
deluge/tests/google.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

View File

@ -56,3 +56,9 @@ class CommonTestCase(unittest.TestCase):
self.failUnless(VersionSplit("0.14.9") == VersionSplit("0.14.9"))
self.failUnless(VersionSplit("0.14.9") > VersionSplit("0.14.5"))
self.failUnless(VersionSplit("0.14.10") >= VersionSplit("0.14.9"))
self.failUnless(VersionSplit("1.4.0") > VersionSplit("1.3.900.dev123"))
self.failUnless(VersionSplit("1.3.2rc2.dev1") < VersionSplit("1.3.2-rc2"))
self.failUnless(VersionSplit("1.3.900.dev888") > VersionSplit("1.3.900.dev123"))
self.failUnless(VersionSplit("1.4.0") > VersionSplit("1.4.0.dev123"))
self.failUnless(VersionSplit("1.4.0.dev1") < VersionSplit("1.4.0"))
self.failUnless(VersionSplit("1.4.0a1") < VersionSplit("1.4.0"))

View File

@ -24,7 +24,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.ico"))
icon = TrackerIcon(os.path.join(dirname, "google.png"))
d = icons.get("www.google.com")
d.addCallback(self.assertNotIdentical, None)
d.addCallback(self.assertEquals, icon)
@ -32,7 +32,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.ico"))
icon = TrackerIcon(os.path.join(dirname, "google.png"))
d = icons.get("google.com")
d.addCallback(self.assertNotIdentical, None)
d.addCallback(self.assertEquals, icon)

View File

@ -41,10 +41,11 @@ except ImportError:
import zlib
import struct
import logging
from twisted.internet.protocol import Protocol
from deluge.log import LOG as log
log = logging.getLogger(__name__)
MESSAGE_HEADER_SIZE = 5