Merge lp:~pedro/mago/tranmission-gtk into lp:~mago-contributors/mago/mago-testsuite

Proposed by Pedro Villavicencio
Status: Merged
Merged at revision: 18
Proposed branch: lp:~pedro/mago/tranmission-gtk
Merge into: lp:~mago-contributors/mago/mago-testsuite
Diff against target: 52 lines (+19/-3)
1 file modified
transmission-gtk/test_transmission-gtk.py (+19/-3)
To merge this branch: bzr merge lp:~pedro/mago/tranmission-gtk
Reviewer Review Type Date Requested Status
Jean-Baptiste Lallement Approve
Review via email: mp+52182@code.launchpad.net

Description of the change

modified the tranmission gtk test case to remove the files on exit and changed the torrent link.

To post a comment you must log in.
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thanks for the fix.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'transmission-gtk/test_transmission-gtk.py'
2--- transmission-gtk/test_transmission-gtk.py 2011-01-18 14:14:41 +0000
3+++ transmission-gtk/test_transmission-gtk.py 2011-03-04 11:28:54 +0000
4@@ -32,6 +32,7 @@
5 import unittest
6 import ldtp
7 import ooldtp
8+import os
9
10 TRANSMISSION = 'frmTransmission'
11 DLG_INFORMATION = 'dlgInformation'
12@@ -48,15 +49,30 @@
13 SPEED = 'lbl*KiB/s'
14 """This is the torrent image we download
15 """
16-TORRENT = 'http://cdimage.ubuntu.com/releases/maverick/release/ubuntu-10.10-dvd-i386.iso.torrent'
17+TORRENT = 'http://releases.ubuntu.com/10.10/ubuntu-10.10-alternate-i386.iso.torrent'
18
19-class TransmissionsTests(TestCase):
20+class TransmissionTests(TestCase):
21 """Launcher for the application transmission
22 """
23 launcher = 'transmission-gtk'
24 window_name = TRANSMISSION
25 setupOnce = True
26
27+ def tearDown(self):
28+ """remove the incompleted files from the Trash and Downloads directory.
29+ """
30+ trash = os.getenv('HOME') + '/.local/share/Trash/files/'
31+ torrents = os.listdir(trash)
32+ for t in torrents:
33+ if t.endswith('part'):
34+ os.remove(trash + t)
35+
36+ download = os.getenv('HOME') + '/Downloads/ubuntu-10.10-alternate-i386.iso.part'
37+ if os.path.exists(download):
38+ os.remove(download)
39+
40+ super(TransmissionTests, self).tearDown()
41+
42 def transmission_01_test_add_torrent(self):
43 """Test that adding a torrent works fine.
44 When you launch transmission for the first time and information dialog
45@@ -110,6 +126,6 @@
46 q.getchild(BTN_REMOVE).click()
47
48 self.assertTrue(table.getrowcount() == 0)
49-
50+
51 if __name__ == "__main__":
52 unittest.main()

Subscribers

People subscribed via source and target branches