Merge lp:~brian.curtin/ubuntuone-control-panel/share-links-windows-corrections into lp:ubuntuone-control-panel

Proposed by Brian Curtin
Status: Merged
Approved by: Brian Curtin
Approved revision: 354
Merged at revision: 359
Proposed branch: lp:~brian.curtin/ubuntuone-control-panel/share-links-windows-corrections
Merge into: lp:ubuntuone-control-panel
Diff against target: 51 lines (+13/-12)
1 file modified
ubuntuone/controlpanel/gui/qt/tests/test_share_links_search.py (+13/-12)
To merge this branch: bzr merge lp:~brian.curtin/ubuntuone-control-panel/share-links-windows-corrections
Reviewer Review Type Date Requested Status
Diego Sarmentero (community) Approve
Roberto Alsina (community) Approve
dobey (community) Approve
Review via email: mp+126063@code.launchpad.net

Commit message

- Use os.path.join to construct platform-safe paths in share links tests

Description of the change

Change some manually built path strings to use os.path.join to create correct paths when run on Windows. Currently the test suite is failing on Windows because of this.

To post a comment you must log in.
354. By Brian Curtin

forgot to break line

Revision history for this message
dobey (dobey) :
review: Approve
Revision history for this message
Roberto Alsina (ralsina) :
review: Approve
Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/controlpanel/gui/qt/tests/test_share_links_search.py'
2--- ubuntuone/controlpanel/gui/qt/tests/test_share_links_search.py 2012-09-14 20:23:13 +0000
3+++ ubuntuone/controlpanel/gui/qt/tests/test_share_links_search.py 2012-09-24 17:59:20 +0000
4@@ -163,12 +163,12 @@
5 data2 = [{'realpath': 'folder2'}]
6 self.ui._process_volumes_info([(0, 0, data1), (0, 0, data2)])
7 expected = [
8- 'other_path/test/qwe',
9- '~/blabla/iop',
10- '~/one/file3',
11- '~/test/asd',
12- '~/ubuntu/file1',
13- '~/ubuntu/file2']
14+ os.path.join('other_path', 'test', 'qwe'),
15+ os.path.join('~', 'blabla', 'iop'),
16+ os.path.join('~', 'one', 'file3'),
17+ os.path.join('~', 'test', 'asd'),
18+ os.path.join('~', 'ubuntu', 'file1'),
19+ os.path.join('~', 'ubuntu', 'file2')]
20 self.assertEqual(self.ui._thread_explore.u1_files, expected)
21 self.assertEqual(self.ui.popup.list_widget.count(), 6)
22
23@@ -183,15 +183,15 @@
24 data2 = [{'realpath': 'folder2'}]
25 self.ui._process_volumes_info([(0, 0, data1), (0, 0, data2)])
26 self.ui.filter('p')
27- expected = ['~/blabla/iop']
28+ expected = [os.path.join('~', 'blabla', 'iop')]
29 self.assertEqual(expected, self.ui.temp_u1_files)
30
31 self.ui.filter('i')
32 expected = [
33- '~/blabla/iop',
34- '~/one/file3',
35- '~/ubuntu/file1',
36- '~/ubuntu/file2']
37+ os.path.join('~', 'blabla', 'iop'),
38+ os.path.join('~', 'one', 'file3'),
39+ os.path.join('~', 'ubuntu', 'file1'),
40+ os.path.join('~', 'ubuntu', 'file2')]
41 self.assertEqual(expected, self.ui.temp_u1_files)
42
43 def test_set_selected_item(self):
44@@ -204,7 +204,8 @@
45 self.ui.popup.list_widget.setCurrentRow(0)
46 item = self.ui.popup.list_widget.currentItem()
47 self.ui._set_selected_item(item)
48- self.assertEqual(self._called, ((u'other_path/test/qwe',), {}))
49+ self.assertEqual(self._called,
50+ ((os.path.join(u'other_path', u'test', u'qwe'),), {}))
51 self.assertEqual(self.ui.text(), '')
52
53

Subscribers

People subscribed via source and target branches