Module: deluge
Branch: master
Commit: 3b6bad2f13b67e9f96d3e81d979111259929a705

Author: Damien Churchill <[email protected]>
Date:   Fri Oct 22 19:47:38 2010 +0100

fix up the tracker icon tests

---

 deluge/tests/test_tracker_icons.py |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/deluge/tests/test_tracker_icons.py 
b/deluge/tests/test_tracker_icons.py
index ecf5ddb..c2eef68 100644
--- a/deluge/tests/test_tracker_icons.py
+++ b/deluge/tests/test_tracker_icons.py
@@ -1,3 +1,5 @@
+import os
+
 from twisted.trial import unittest
 
 from deluge.ui.tracker_icons import TrackerIcons, TrackerIcon
@@ -7,10 +9,13 @@ import common
 common.set_tmp_config_dir()
 icons = TrackerIcons()
 
+dirname = os.path.dirname(__file__)
+
 class TrackerIconsTestCase(unittest.TestCase):
+
     def test_get_deluge_png(self):
         # Deluge has a png favicon link
-        icon = TrackerIcon("../deluge.png")
+        icon = TrackerIcon(os.path.join(dirname, "deluge.png"))
         d = icons.get("deluge-torrent.org")
         d.addCallback(self.assertNotIdentical, None)
         d.addCallback(self.assertEquals, icon)
@@ -19,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("../google.ico")
+        icon = TrackerIcon(os.path.join(dirname, "google.ico"))
         d = icons.get("www.google.com")
         d.addCallback(self.assertNotIdentical, None)
         d.addCallback(self.assertEquals, icon)
@@ -27,7 +32,7 @@ class TrackerIconsTestCase(unittest.TestCase):
 
     def test_get_google_ico_with_redirect(self):
         # google.com redirects to www.google.com
-        icon = TrackerIcon("../google.ico")
+        icon = TrackerIcon(os.path.join(dirname, "google.ico"))
         d = icons.get("google.com")
         d.addCallback(self.assertNotIdentical, None)
         d.addCallback(self.assertEquals, icon)
@@ -48,14 +53,14 @@ class TrackerIconsTestCase(unittest.TestCase):
 
     def test_get_openbt_png(self):
         # openbittorrent.com has an incorrect type (image/gif)
-        icon = TrackerIcon("../openbt.png")
+        icon = TrackerIcon(os.path.join(dirname, "openbt.png"))
         d = icons.get("openbittorrent.com")
         d.addCallback(self.assertNotIdentical, None)
         d.addCallback(self.assertEquals, icon)
         return d
 
     def test_get_publicbt_ico(self):
-        icon = TrackerIcon("../publicbt.ico")
+        icon = TrackerIcon(os.path.join(dirname, "publicbt.ico"))
         d = icons.get("publicbt.org")
         d.addCallback(self.assertNotIdentical, None)
         d.addCallback(self.assertEquals, icon)

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