From 607be461e013438271bdf886a1c48cc961a34cfc Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Wed, 1 May 2013 04:13:05 +0100 Subject: [PATCH] Fix and update tests --- deluge/tests/common.py | 2 +- deluge/tests/google.ico | Bin 5430 -> 0 bytes deluge/tests/google.png | Bin 0 -> 640 bytes deluge/tests/test_common.py | 6 ++++++ deluge/tests/test_tracker_icons.py | 4 ++-- deluge/transfer.py | 3 ++- 6 files changed, 11 insertions(+), 4 deletions(-) delete mode 100644 deluge/tests/google.ico create mode 100644 deluge/tests/google.png diff --git a/deluge/tests/common.py b/deluge/tests/common.py index 54cab32a4..bbe09dbf2 100644 --- a/deluge/tests/common.py +++ b/deluge/tests/common.py @@ -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: diff --git a/deluge/tests/google.ico b/deluge/tests/google.ico deleted file mode 100644 index f594697d2f9edeb4e5b921d406a0b4b60512bfae..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5430 zcmc&&=}#3`6d#*@^NZ)MUY=zx&5q8s`(D$uOmJ5Bh+pfZW`2?cs>vue*g>c$$ zK(EWJ!+qTe^Zbr?vTyxjo~wf0d~OImb?xS*-{CyE1-10k1h1$pk~Y~*rxUbPx#V~K z$Qts&QJ5EYz`VK_p86W@tEUi^UqzBn=qf3Mr}e}6uNh+NoUCNE-AiGftpwn~IJq$^ zS@TQ6wv&HCdVT=DDb3-GaPFs(fotv0L^s1h?B+`jK!FYJ(*@N%{Vcl=weL9 zW?Q20j|LB8_vaCRFeXJ?Rx0@zb79}jonZBfgj)v zzNDDv4;hEDpYZ(_4St6l_Hx)1Ey5>utTmCkP*Q=P|6 z@I)`Pns3wcq>~$t#m2u0mmXgv}EKR4mbFXV=NEOby2^q+tnszwA#fZ zw!v<_B6V@?5ZILI?)7y`8RJxGWSKCX`mwcA7hDHo+x(3BjE2oVKV7rU&tW!Lw@yl( zZs&txYYn5mn7+O3Qlj5l%;A0^Tz<7$-K288+9_!SK{qh~vCv z^NmE+f&d=Y^+RK_ZhhYh*muvs?fD1p^LAOou@T&pgvI4-)-)V1*Zje7|9=Gi;7<_c zUqajUoy?287ev|YQSk%!9>L)JJEU)*oCr8RESjF8O9^_%Wf2 zCdaiOkFfRY`&Y}~`NFken4X;JCDZ+$jrzqQ{r2XW;Pc4C(+4O|7sZcH@n8J>sBGCcR2TQ%^|iggi7}2yw;Fh6X?_SE|>Yw?dgy;uUvS_McSCYuT8Zp m-~C6v`!DW8^VNR_J@Ch5!&vo#{Jj~AF_rcF_duQoW4{4Gi({hz diff --git a/deluge/tests/google.png b/deluge/tests/google.png new file mode 100644 index 0000000000000000000000000000000000000000..553ad65ba467b953d78e440286c5c150b83c98bd GIT binary patch literal 640 zcmV-`0)PF9P)lfwG46EsID}3l!YlU}M2^ z;CzpVj-dC5OW#q4iCN9$ykTzBAcCZr7F7Y0GL%BNb;hS{pW^Y9=I*l+-+ssB>V!8- z5w1fe1hA?K2DE|Z9Gva+SXhq9`mhzklWEQA6E3Yyf;K52B~jFbq+&S=y4xLsGDODm zC$M}e!~|g?WNlQh7H}18mMo7ZLk7ECuJn5xY8Fm*xZHmk5@>KFsr`q5RQ-%Ej7@8X zM@#H)5XNrj__$(t@j=s=NoxMvLG3q6+A_5m@%&wc@4>llmyUxD#d0zeJL>Zz#T}eF zg267A_5+HQHA_PVF708ajd(FeikZTVD zl)#MvpD^0t!Zv}4VUI6d>~(oHA2IjU;5pDzFDxt@#%DB*+3lBW2`nV`lp~n^6mzxT z`_+HddEO0Ykudz*>uS9jMO;K?tksmemc5@DJFg an4!N7-1fDa5{=sc0000 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")) diff --git a/deluge/tests/test_tracker_icons.py b/deluge/tests/test_tracker_icons.py index 4f8782d4f..c671b4f3e 100644 --- a/deluge/tests/test_tracker_icons.py +++ b/deluge/tests/test_tracker_icons.py @@ -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) diff --git a/deluge/transfer.py b/deluge/transfer.py index a09ad98a5..f27a65460 100644 --- a/deluge/transfer.py +++ b/deluge/transfer.py @@ -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