Merge lp:~elopio/ubuntu-filemanager-app/fix1201483-pep8 into lp:ubuntu-filemanager-app

Proposed by Leo Arias
Status: Merged
Approved by: Michael Spencer
Approved revision: 50
Merged at revision: 47
Proposed branch: lp:~elopio/ubuntu-filemanager-app/fix1201483-pep8
Merge into: lp:ubuntu-filemanager-app
Diff against target: 201 lines (+46/-25)
3 files modified
tests/autopilot/ubuntu_filemanager_app/emulators/main_window.py (+6/-3)
tests/autopilot/ubuntu_filemanager_app/emulators/ubuntusdk.py (+7/-3)
tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py (+33/-19)
To merge this branch: bzr merge lp:~elopio/ubuntu-filemanager-app/fix1201483-pep8
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Michael Spencer Approve
Review via email: mp+174813@code.launchpad.net

Commit message

Fixed pep8 errors.

To post a comment you must log in.
Revision history for this message
Michael Spencer (ibelieve) wrote :

Nice, thank you!

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/ubuntu_filemanager_app/emulators/main_window.py'
2--- tests/autopilot/ubuntu_filemanager_app/emulators/main_window.py 2013-06-28 17:40:53 +0000
3+++ tests/autopilot/ubuntu_filemanager_app/emulators/main_window.py 2013-07-15 16:15:33 +0000
4@@ -18,10 +18,12 @@
5
6 def get_file_item(self, index):
7 """Returns the list view folder with index number."""
8- return self.app.select_single('FolderListPage').select_many("FolderListDelegate")[index]
9+ return self.app.select_single('FolderListPage').select_many(
10+ "FolderListDelegate")[index]
11
12 def get_file_count(self):
13- return len(self.app.select_single('FolderListPage').select_many("FolderListDelegate"))
14+ return len(self.app.select_single('FolderListPage').select_many(
15+ "FolderListDelegate"))
16
17 def get_action_popover(self):
18 # Returns all instances, but with current one as first index
19@@ -31,7 +33,8 @@
20 return self.app.select_single('FolderListView').folderPath
21
22 def get_filenames(self):
23- folders = self.app.select_single('FolderListPage').select_many("FolderListDelegate")
24+ folders = self.app.select_single('FolderListPage').select_many(
25+ "FolderListDelegate")
26 names = []
27 for folder in folders:
28 names += [folder.fileName]
29
30=== modified file 'tests/autopilot/ubuntu_filemanager_app/emulators/ubuntusdk.py'
31--- tests/autopilot/ubuntu_filemanager_app/emulators/ubuntusdk.py 2013-06-28 16:08:14 +0000
32+++ tests/autopilot/ubuntu_filemanager_app/emulators/ubuntusdk.py 2013-07-15 16:15:33 +0000
33@@ -19,8 +19,10 @@
34 from testtools.matchers import Equals, NotEquals, Not, Is
35 from autopilot.matchers import Eventually
36
37+
38 class ubuntusdk(object):
39- """An emulator class that makes it easy to interact with the ubuntu sdk applications."""
40+ """An emulator class that makes it easy to interact with the ubuntu sdk
41+ applications."""
42
43 def __init__(self, autopilot, app):
44 self.app = app
45@@ -107,7 +109,8 @@
46 def set_popup_value(self, popover, button, value):
47 """Changes the given popover selector to the request value
48 At the moment this only works for values that are currently visible. To
49- access the remaining items, a help method to drag and recheck is needed."""
50+ access the remaining items, a help method to drag and recheck is
51+ needed."""
52 #The popover is assumed to be the following format
53 # Popover {
54 # Column {
55@@ -117,7 +120,8 @@
56 # text: value
57
58 self.autopilot.pointing_device.click_object(button)
59- #we'll get all matching objects, incase the popover is reused between buttons
60+ # we'll get all matching objects, incase the popover is reused between
61+ # buttons
62 itemList = lambda: self.get_objects("Standard", popover)
63
64 for item in itemList():
65
66=== modified file 'tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py'
67--- tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py 2013-07-09 19:13:02 +0000
68+++ tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py 2013-07-15 16:15:33 +0000
69@@ -40,7 +40,8 @@
70 def _get_place(self, name):
71 """Returns the place/bookmark with index number."""
72 self.ubuntusdk.click_toolbar_button('Places')
73- places_popover = self.app.select_single('Popover', objectName='placesPopover')
74+ places_popover = self.app.select_single(
75+ 'Popover', objectName='placesPopover')
76 places = places_popover.select_many('Standard')
77 for place in places:
78 if place.text == name:
79@@ -92,7 +93,8 @@
80 sub_dir = self._make_directory_in_home()
81
82 first_folder = self.main_window.get_file_item(0)
83- self.assertThat(first_folder.fileName,
84+ self.assertThat(
85+ first_folder.fileName,
86 Eventually(Equals(os.path.split(sub_dir)[1])))
87
88 self.pointing_device.click_object(first_folder)
89@@ -114,7 +116,9 @@
90
91 self._cancel_action()
92
93- self.assertThat(lambda: self.main_window.get_filenames()[0], Eventually(Equals(dir_name)))
94+ self.assertThat(
95+ lambda: self.main_window.get_filenames()[0], Eventually(
96+ Equals(dir_name)))
97
98 self.tap_item(first_folder)
99 action_popover = self.main_window.get_action_popover()
100@@ -122,7 +126,9 @@
101
102 self._provide_input(new_name)
103
104- self.assertThat(lambda: self.main_window.get_filenames()[0], Eventually(Equals(new_name)))
105+ self.assertThat(
106+ lambda: self.main_window.get_filenames()[0], Eventually(
107+ Equals(new_name)))
108
109 def test_rename_file(self):
110 path = self._make_file_in_home()
111@@ -137,7 +143,9 @@
112
113 self._cancel_action()
114
115- self.assertThat(lambda: self.main_window.get_filenames()[0], Eventually(Equals(name)))
116+ self.assertThat(
117+ lambda: self.main_window.get_filenames()[0], Eventually(
118+ Equals(name)))
119
120 self.tap_item(first_file)
121 action_popover = self.main_window.get_action_popover()
122@@ -145,8 +153,9 @@
123
124 self._provide_input(new_name)
125
126- self.assertThat(lambda: self.main_window.get_filenames()[0], Eventually(Equals(new_name)))
127-
128+ self.assertThat(
129+ lambda: self.main_window.get_filenames()[0], Eventually(
130+ Equals(new_name)))
131
132 def test_delete_directory(self):
133 sub_dir = self._make_directory_in_home()
134@@ -194,13 +203,16 @@
135 #self._go_to_place('Home')
136 self.ubuntusdk.click_toolbar_button('Actions')
137
138- popover = self.app.select_single("ActionSelectionPopover", objectName='folderActionsPopover')
139+ popover = self.app.select_single(
140+ "ActionSelectionPopover", objectName='folderActionsPopover')
141 self._run_action(popover, 'Create New Folder')
142 self._provide_input(name)
143
144 self.assertThat(self.main_window.get_file_count, Eventually(Equals(1)))
145
146- self.assertThat(lambda: self.main_window.get_filenames()[0], Eventually(Equals(name)))
147+ self.assertThat(
148+ lambda: self.main_window.get_filenames()[0], Eventually(
149+ Equals(name)))
150
151 def test_going_up(self):
152 upDir = os.path.split(os.environ['HOME'])[0]
153@@ -227,10 +239,12 @@
154 place = self._get_place(name)
155 self.pointing_device.click_object(place)
156
157- def _check_location(self,title,location):
158- self.assertThat(self.main_window.get_page_title, Eventually(Equals(title)))
159+ def _check_location(self, title, location):
160+ self.assertThat(
161+ self.main_window.get_page_title, Eventually(Equals(title)))
162
163- self.assertThat(self.main_window.get_current_folder_name,
164+ self.assertThat(
165+ self.main_window.get_current_folder_name,
166 Eventually(Equals(location)))
167
168 def _run_action(self, popover, name):
169@@ -243,16 +257,17 @@
170
171 def _confirm_action(self):
172 dialog = self.app.select_single('ConfirmDialog')
173- if dialog == None:
174+ if dialog is None:
175 dialog = self.app.select_single('ConfirmDialogWithInput')
176- okButton = dialog.select_single('Button',objectName='okButton')
177+ okButton = dialog.select_single('Button', objectName='okButton')
178 self.pointing_device.click_object(okButton)
179
180 def _cancel_action(self):
181 dialog = self.app.select_single('ConfirmDialog')
182- if dialog == None:
183+ if dialog is None:
184 dialog = self.app.select_single('ConfirmDialogWithInput')
185- cancelButton = dialog.select_single('Button',objectName='cancelButton')
186+ cancelButton = dialog.select_single(
187+ 'Button', objectName='cancelButton')
188 self.pointing_device.click_object(cancelButton)
189
190 def _provide_input(self, text):
191@@ -271,8 +286,7 @@
192 self.pointing_device.click_object(field)
193
194 self.keyboard.type(text)
195- self.assertThat(field.text,
196- Eventually(Equals(text)))
197+ self.assertThat(field.text, Eventually(Equals(text)))
198
199- okButton = dialog.select_single('Button',objectName='okButton')
200+ okButton = dialog.select_single('Button', objectName='okButton')
201 self.pointing_device.click_object(okButton)

Subscribers

People subscribed via source and target branches