Merge lp:~martin-borho/ubuntu-weather-app/lamda_asserts into lp:ubuntu-weather-app/obsolete.trunk
- lamda_asserts
- Merge into trunk
Proposed by
Martin Borho
Status: | Merged |
---|---|
Approved by: | Nicholas Skaggs |
Approved revision: | 95 |
Merged at revision: | 94 |
Proposed branch: | lp:~martin-borho/ubuntu-weather-app/lamda_asserts |
Merge into: | lp:ubuntu-weather-app/obsolete.trunk |
Diff against target: |
239 lines (+31/-30) 3 files modified
tests/autopilot/ubuntu_weather_app/tests/test_locationmanager.py (+20/-20) tests/autopilot/ubuntu_weather_app/tests/test_mainview.py (+3/-3) tests/autopilot/ubuntu_weather_app/tests/test_settings.py (+8/-7) |
To merge this branch: | bzr merge lp:~martin-borho/ubuntu-weather-app/lamda_asserts |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Nicholas Skaggs (community) | Approve | ||
Review via email: mp+180237@code.launchpad.net |
Commit message
using lambda asserts on objects beforehand
Description of the change
using lambda asserts on objects beforehand
To post a comment you must log in.
Revision history for this message
Nicholas Skaggs (nskaggs) : | # |
review:
Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
review:
Approve
(continuous-integration)
- 95. By Martin Borho
-
fix for swipe_to_delete gesture
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:95
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
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_weather_app/tests/test_locationmanager.py' | |||
2 | --- tests/autopilot/ubuntu_weather_app/tests/test_locationmanager.py 2013-08-12 18:34:13 +0000 | |||
3 | +++ tests/autopilot/ubuntu_weather_app/tests/test_locationmanager.py 2013-08-14 21:31:47 +0000 | |||
4 | @@ -9,7 +9,7 @@ | |||
5 | 9 | 9 | ||
6 | 10 | from __future__ import absolute_import | 10 | from __future__ import absolute_import |
7 | 11 | 11 | ||
9 | 12 | from testtools.matchers import Equals, NotEquals | 12 | from testtools.matchers import Equals, NotEquals, Is, Not |
10 | 13 | from autopilot.matchers import Eventually | 13 | from autopilot.matchers import Eventually |
11 | 14 | 14 | ||
12 | 15 | from ubuntu_weather_app.tests import WeatherTestCase, DatabaseMixin, SheetMixin | 15 | from ubuntu_weather_app.tests import WeatherTestCase, DatabaseMixin, SheetMixin |
13 | @@ -26,8 +26,8 @@ | |||
14 | 26 | self.get_qml_view().visible, Eventually(Equals(True))) | 26 | self.get_qml_view().visible, Eventually(Equals(True))) |
15 | 27 | 27 | ||
16 | 28 | def search_for_city(self, city): | 28 | def search_for_city(self, city): |
17 | 29 | self.assertThat(lambda: self.main_window.get_object('TextField', 'SearchField'), Eventually(Not(Is(None)))) | ||
18 | 29 | searchField = self.main_window.get_object("TextField", "SearchField") | 30 | searchField = self.main_window.get_object("TextField", "SearchField") |
19 | 30 | self.assertThat(lambda: searchField.visible, Eventually(Equals(True))) | ||
20 | 31 | #poll clicking for focus for lack of better method, due to screen switching animation | 31 | #poll clicking for focus for lack of better method, due to screen switching animation |
21 | 32 | #is there a property we can use instead? | 32 | #is there a property we can use instead? |
22 | 33 | timeout = 0 | 33 | timeout = 0 |
23 | @@ -43,8 +43,8 @@ | |||
24 | 43 | def _open_add_location_page(self): | 43 | def _open_add_location_page(self): |
25 | 44 | """Opens the AddLocationPage""" | 44 | """Opens the AddLocationPage""" |
26 | 45 | # click on listitem to open AddLocationPage | 45 | # click on listitem to open AddLocationPage |
27 | 46 | self.assertThat(lambda: self.main_window.get_object('QQuickListView', 'LocationList'), Eventually(Not(Is(None)))) | ||
28 | 46 | locationList = self.main_window.get_object('QQuickListView', 'LocationList') | 47 | locationList = self.main_window.get_object('QQuickListView', 'LocationList') |
29 | 47 | self.assertThat(lambda: locationList.visible, Eventually(Equals(True))) | ||
30 | 48 | addCityItem = locationList.get_children()[0] | 48 | addCityItem = locationList.get_children()[0] |
31 | 49 | self.assertThat(lambda: addCityItem.visible, Eventually(Equals(True))) | 49 | self.assertThat(lambda: addCityItem.visible, Eventually(Equals(True))) |
32 | 50 | self.pointing_device.move_to_object(addCityItem) | 50 | self.pointing_device.move_to_object(addCityItem) |
33 | @@ -73,22 +73,22 @@ | |||
34 | 73 | self.search_for_city("London") | 73 | self.search_for_city("London") |
35 | 74 | 74 | ||
36 | 75 | # wait for results and click on the first item | 75 | # wait for results and click on the first item |
39 | 76 | http_failed = self.main_window.get_object('Dialog', 'HTTPFailedDialog') | 76 | http_failed = lambda: self.main_window.get_object('Dialog', 'HTTPFailedDialog').visible |
40 | 77 | self.assertThat(lambda: http_failed.visible, Eventually(NotEquals(True))) | 77 | self.assertThat(http_failed, Eventually(NotEquals(True))) |
41 | 78 | load_indicator = self.main_window.get_object('ActivityIndicator', 'SearchingSpinner') | 78 | load_indicator = self.main_window.get_object('ActivityIndicator', 'SearchingSpinner') |
42 | 79 | self.assertThat(load_indicator.running, Eventually(Equals(False), timeout=120)) | 79 | self.assertThat(load_indicator.running, Eventually(Equals(False), timeout=120)) |
43 | 80 | resultsList = self.main_window.get_object('QQuickListView', 'SearchResultList') | 80 | resultsList = self.main_window.get_object('QQuickListView', 'SearchResultList') |
44 | 81 | self.assertThat(resultsList.visible, Eventually(Equals(True))) | 81 | self.assertThat(resultsList.visible, Eventually(Equals(True))) |
45 | 82 | self.assertThat(lambda: self.main_window.get_object('Standard', 'searchResult0'), Eventually(Not(Is(None)))) | ||
46 | 82 | firstResult = self.main_window.get_object('Standard', 'searchResult0') | 83 | firstResult = self.main_window.get_object('Standard', 'searchResult0') |
47 | 83 | self.assertThat(lambda: firstResult, Eventually(NotEquals(None))) | ||
48 | 84 | self.pointing_device.move_to_object(firstResult) | 84 | self.pointing_device.move_to_object(firstResult) |
49 | 85 | self.pointing_device.click() | 85 | self.pointing_device.click() |
50 | 86 | 86 | ||
51 | 87 | # LocationManagerPage should be visible and "London" added | 87 | # LocationManagerPage should be visible and "London" added |
52 | 88 | self.assertThat(lambda: self.main_window.get_object('QQuickListView', 'LocationList'), Eventually(Not(Is(None)))) | ||
53 | 88 | locationList = self.main_window.get_object('QQuickListView', 'LocationList') | 89 | locationList = self.main_window.get_object('QQuickListView', 'LocationList') |
55 | 89 | self.assertThat(lambda: locationList, Eventually(NotEquals(None))) | 90 | self.assertThat(lambda: self.main_window.get_object('Standard', 'existingLocation0'), Eventually(Not(Is(None)))) |
56 | 90 | addedItem = self.main_window.get_object('Standard', "existingLocation0") | 91 | addedItem = self.main_window.get_object('Standard', "existingLocation0") |
57 | 91 | self.assertThat(lambda: addedItem, Eventually(NotEquals(None))) | ||
58 | 92 | self.assertThat(addedItem.text, Eventually(Equals("London"))) | 92 | self.assertThat(addedItem.text, Eventually(Equals("London"))) |
59 | 93 | self._click_sheet_confirm() | 93 | self._click_sheet_confirm() |
60 | 94 | 94 | ||
61 | @@ -110,19 +110,19 @@ | |||
62 | 110 | searchField = self.search_for_city("London") | 110 | searchField = self.search_for_city("London") |
63 | 111 | 111 | ||
64 | 112 | # wait for results and click on the first item | 112 | # wait for results and click on the first item |
67 | 113 | http_failed = self.main_window.get_object('Dialog', 'HTTPFailedDialog') | 113 | http_failed = lambda: self.main_window.get_object('Dialog', 'HTTPFailedDialog').visible |
68 | 114 | self.assertThat(lambda: http_failed.visible, Eventually(NotEquals(True))) | 114 | self.assertThat(http_failed, Eventually(NotEquals(True))) |
69 | 115 | load_indicator = self.main_window.get_object('ActivityIndicator', 'SearchingSpinner') | 115 | load_indicator = self.main_window.get_object('ActivityIndicator', 'SearchingSpinner') |
70 | 116 | self.assertThat(load_indicator.running, Eventually(Equals(False), timeout=120)) | 116 | self.assertThat(load_indicator.running, Eventually(Equals(False), timeout=120)) |
71 | 117 | resultsList = self.main_window.get_object('QQuickListView', 'SearchResultList') | 117 | resultsList = self.main_window.get_object('QQuickListView', 'SearchResultList') |
72 | 118 | self.assertThat(resultsList.visible, Eventually(Equals(True))) | 118 | self.assertThat(resultsList.visible, Eventually(Equals(True))) |
73 | 119 | self.assertThat(lambda: self.main_window.get_object('Standard', 'searchResult0'), Eventually(Not(Is(None)))) | ||
74 | 119 | firstResult = self.select_single_retry("Standard", objectName="searchResult0") | 120 | firstResult = self.select_single_retry("Standard", objectName="searchResult0") |
77 | 120 | self.assertThat(lambda: firstResult, Eventually(NotEquals(None))) | 121 | self.assertThat(firstResult.text, Eventually(Equals("London, United Kingdom"))) |
76 | 121 | self.assertThat(firstResult.text, Eventually(Equals("London, GB"))) | ||
78 | 122 | 122 | ||
79 | 123 | # clear search field and do another search | 123 | # clear search field and do another search |
80 | 124 | self.assertThat(lambda: self.main_window.select_single('AbstractButton'), Eventually(Not(Is(None)))) | ||
81 | 124 | clear_button = searchField.select_single("AbstractButton") | 125 | clear_button = searchField.select_single("AbstractButton") |
82 | 125 | self.assertThat(lambda: clear_button, Eventually(NotEquals(None))) | ||
83 | 126 | self.pointing_device.click_object(clear_button) | 126 | self.pointing_device.click_object(clear_button) |
84 | 127 | self.assertThat(searchField.text, Eventually(Equals(""))) | 127 | self.assertThat(searchField.text, Eventually(Equals(""))) |
85 | 128 | 128 | ||
86 | @@ -132,14 +132,15 @@ | |||
87 | 132 | load_indicator = self.main_window.get_object('ActivityIndicator', 'SearchingSpinner') | 132 | load_indicator = self.main_window.get_object('ActivityIndicator', 'SearchingSpinner') |
88 | 133 | self.assertThat(load_indicator.running, Eventually(Equals(False), timeout=120)) | 133 | self.assertThat(load_indicator.running, Eventually(Equals(False), timeout=120)) |
89 | 134 | self.assertThat(resultsList.visible, Eventually(Equals(True))) | 134 | self.assertThat(resultsList.visible, Eventually(Equals(True))) |
90 | 135 | self.assertThat(lambda: self.main_window.get_object('Standard', 'searchResult0'), Eventually(Not(Is(None)))) | ||
91 | 135 | firstResult = self.select_single_retry("Standard", objectName="searchResult0") | 136 | firstResult = self.select_single_retry("Standard", objectName="searchResult0") |
94 | 136 | self.assertThat(lambda: firstResult, Eventually(NotEquals(None))) | 137 | self.assertThat(firstResult.text, Eventually(Equals("Hamburg, Germany"))) |
93 | 137 | self.assertThat(firstResult.text, Eventually(Equals("Hamburg, DE"))) | ||
95 | 138 | 138 | ||
96 | 139 | def test_cancel_adding_location(self): | 139 | def test_cancel_adding_location(self): |
97 | 140 | """Cancel the cities search""" | 140 | """Cancel the cities search""" |
98 | 141 | self._open_add_location_page() | 141 | self._open_add_location_page() |
99 | 142 | self._click_sheet_cancel() | 142 | self._click_sheet_cancel() |
100 | 143 | self.assertThat(lambda: self.main_window.get_object('QQuickListView', 'LocationList'), Eventually(Not(Is(None)))) | ||
101 | 143 | locationList = self.main_window.get_object('QQuickListView', 'LocationList') | 144 | locationList = self.main_window.get_object('QQuickListView', 'LocationList') |
102 | 144 | self.assertThat(locationList.visible, Eventually(Equals(True))) | 145 | self.assertThat(locationList.visible, Eventually(Equals(True))) |
103 | 145 | 146 | ||
104 | @@ -151,8 +152,8 @@ | |||
105 | 151 | self.search_for_city("UbuntuCity") | 152 | self.search_for_city("UbuntuCity") |
106 | 152 | 153 | ||
107 | 153 | # wait for result and look if label is shown | 154 | # wait for result and look if label is shown |
110 | 154 | http_failed = self.main_window.get_object('Dialog', 'HTTPFailedDialog') | 155 | http_failed = lambda: self.main_window.get_object('Dialog', 'HTTPFailedDialog').visible |
111 | 155 | self.assertThat(lambda: http_failed.visible, Eventually(NotEquals(True))) | 156 | self.assertThat(http_failed, Eventually(NotEquals(True))) |
112 | 156 | load_indicator = self.main_window.get_object('ActivityIndicator', 'SearchingSpinner') | 157 | load_indicator = self.main_window.get_object('ActivityIndicator', 'SearchingSpinner') |
113 | 157 | self.assertThat(load_indicator.running, Eventually(Equals(False), timeout=120)) | 158 | self.assertThat(load_indicator.running, Eventually(Equals(False), timeout=120)) |
114 | 158 | errorLabel = self.main_window.get_object('Label', 'noCityError') | 159 | errorLabel = self.main_window.get_object('Label', 'noCityError') |
115 | @@ -176,14 +177,13 @@ | |||
116 | 176 | def _swipe_location_to_remove(self): | 177 | def _swipe_location_to_remove(self): |
117 | 177 | """Swipe right to delete the first location""" | 178 | """Swipe right to delete the first location""" |
118 | 178 | number_of_locations = self._get_number_of_locations() | 179 | number_of_locations = self._get_number_of_locations() |
119 | 180 | self.assertThat(lambda: self.app.select_single('Standard', objectName='existingLocation0'), Eventually(Not(Is(None)))) | ||
120 | 179 | firstLocation = self.app.select_single("Standard", objectName="existingLocation0") | 181 | firstLocation = self.app.select_single("Standard", objectName="existingLocation0") |
121 | 180 | self.assertThat(lambda: firstLocation, Eventually(NotEquals(None))) | ||
122 | 181 | 182 | ||
123 | 182 | x, y, w, h = firstLocation.globalRect | 183 | x, y, w, h = firstLocation.globalRect |
124 | 183 | tx = x + (w / 8) | 184 | tx = x + (w / 8) |
125 | 184 | ty = y + (h / 2) | 185 | ty = y + (h / 2) |
128 | 185 | 186 | self.pointing_device.drag(tx, ty, tx + (w - w / 8), ty) | |
127 | 186 | self.pointing_device.drag(tx, ty, w - (w / 8), ty) | ||
129 | 187 | self.assertThat( | 187 | self.assertThat( |
130 | 188 | self._get_number_of_locations(), | 188 | self._get_number_of_locations(), |
131 | 189 | Eventually(Equals(number_of_locations-1))) | 189 | Eventually(Equals(number_of_locations-1))) |
132 | 190 | 190 | ||
133 | === modified file 'tests/autopilot/ubuntu_weather_app/tests/test_mainview.py' | |||
134 | --- tests/autopilot/ubuntu_weather_app/tests/test_mainview.py 2013-08-13 04:56:41 +0000 | |||
135 | +++ tests/autopilot/ubuntu_weather_app/tests/test_mainview.py 2013-08-14 21:31:47 +0000 | |||
136 | @@ -11,7 +11,7 @@ | |||
137 | 11 | 11 | ||
138 | 12 | from __future__ import absolute_import | 12 | from __future__ import absolute_import |
139 | 13 | 13 | ||
141 | 14 | from testtools.matchers import NotEquals, Equals | 14 | from testtools.matchers import NotEquals, Equals, Is, Not |
142 | 15 | from autopilot.matchers import Eventually | 15 | from autopilot.matchers import Eventually |
143 | 16 | 16 | ||
144 | 17 | import unittest | 17 | import unittest |
145 | @@ -56,8 +56,8 @@ | |||
146 | 56 | 56 | ||
147 | 57 | def test_refresh_tabs(self): | 57 | def test_refresh_tabs(self): |
148 | 58 | # get the dates from the test data | 58 | # get the dates from the test data |
149 | 59 | self.assertThat(lambda: self.main_window.get_objects('Label', 'DayDateLabel'), Eventually(Not(Is(None)))) | ||
150 | 59 | curr_dates = self.main_window.get_objects('Label','DayDateLabel') | 60 | curr_dates = self.main_window.get_objects('Label','DayDateLabel') |
151 | 60 | self.assertThat(lambda: curr_dates, Eventually(NotEquals(None))) | ||
152 | 61 | tab1_curr_date = curr_dates[0].text | 61 | tab1_curr_date = curr_dates[0].text |
153 | 62 | tab2_curr_date = curr_dates[2].text | 62 | tab2_curr_date = curr_dates[2].text |
154 | 63 | 63 | ||
155 | @@ -67,7 +67,7 @@ | |||
156 | 67 | self.assertThat(load_indicator.running, Eventually(Equals(False), timeout=120)) | 67 | self.assertThat(load_indicator.running, Eventually(Equals(False), timeout=120)) |
157 | 68 | 68 | ||
158 | 69 | # get the data from the refreshed tabs, have to be new | 69 | # get the data from the refreshed tabs, have to be new |
159 | 70 | self.assertThat(lambda: self.main_window.get_objects('Label', 'DayDateLabel'), Eventually(Not(Is(None)))) | ||
160 | 70 | refreshed_dates = self.main_window.get_objects('Label','DayDateLabel') | 71 | refreshed_dates = self.main_window.get_objects('Label','DayDateLabel') |
161 | 71 | self.assertThat(lambda: refreshed_dates, Eventually(NotEquals(None))) | ||
162 | 72 | self.assertNotEqual(tab1_curr_date, refreshed_dates[0].text) | 72 | self.assertNotEqual(tab1_curr_date, refreshed_dates[0].text) |
163 | 73 | self.assertNotEqual(tab2_curr_date, refreshed_dates[2].text) | 73 | self.assertNotEqual(tab2_curr_date, refreshed_dates[2].text) |
164 | 74 | 74 | ||
165 | === modified file 'tests/autopilot/ubuntu_weather_app/tests/test_settings.py' | |||
166 | --- tests/autopilot/ubuntu_weather_app/tests/test_settings.py 2013-08-08 19:55:17 +0000 | |||
167 | +++ tests/autopilot/ubuntu_weather_app/tests/test_settings.py 2013-08-14 21:31:47 +0000 | |||
168 | @@ -9,7 +9,7 @@ | |||
169 | 9 | 9 | ||
170 | 10 | from __future__ import absolute_import | 10 | from __future__ import absolute_import |
171 | 11 | 11 | ||
173 | 12 | from testtools.matchers import Equals, NotEquals | 12 | from testtools.matchers import Equals, NotEquals, Is, Not |
174 | 13 | from autopilot.matchers import Eventually | 13 | from autopilot.matchers import Eventually |
175 | 14 | 14 | ||
176 | 15 | from ubuntu_weather_app.tests import WeatherTestCase, DatabaseMixin, SheetMixin | 15 | from ubuntu_weather_app.tests import WeatherTestCase, DatabaseMixin, SheetMixin |
177 | @@ -30,8 +30,8 @@ | |||
178 | 30 | 30 | ||
179 | 31 | def _move_pointer_around(self): | 31 | def _move_pointer_around(self): |
180 | 32 | """Helper method to move the pointer around, to assure selector is opened""" | 32 | """Helper method to move the pointer around, to assure selector is opened""" |
181 | 33 | self.assertThat(lambda: self.main_window.get_object('ComposerSheet', 'SettingsSheet'), Eventually(Not(Is(None)))) | ||
182 | 33 | sheet = self.main_window.get_object('ComposerSheet', 'SettingsSheet') | 34 | sheet = self.main_window.get_object('ComposerSheet', 'SettingsSheet') |
183 | 34 | self.assertThat(lambda: sheet, Eventually(NotEquals(None))) | ||
184 | 35 | self.pointing_device.move_to_object(sheet) | 35 | self.pointing_device.move_to_object(sheet) |
185 | 36 | 36 | ||
186 | 37 | def _check_units(self, units): | 37 | def _check_units(self, units): |
187 | @@ -51,14 +51,15 @@ | |||
188 | 51 | self._open_settings_sheet() | 51 | self._open_settings_sheet() |
189 | 52 | 52 | ||
190 | 53 | # open the value selector | 53 | # open the value selector |
191 | 54 | self.assertThat(lambda: self.main_window.get_object('ValueSelector', 'UnitsSelector'), Eventually(Not(Is(None)))) | ||
192 | 54 | units_selector = self.main_window.get_object('ValueSelector', "UnitsSelector") | 55 | units_selector = self.main_window.get_object('ValueSelector', "UnitsSelector") |
193 | 55 | self.assertThat(units_selector.selectedIndex, Eventually(Equals(0))) | 56 | self.assertThat(units_selector.selectedIndex, Eventually(Equals(0))) |
194 | 56 | self.pointing_device.click_object(units_selector) | 57 | self.pointing_device.click_object(units_selector) |
195 | 57 | 58 | ||
196 | 58 | # choose second option, fahrenheit | 59 | # choose second option, fahrenheit |
197 | 59 | self._move_pointer_around() | 60 | self._move_pointer_around() |
198 | 61 | self.assertThat(lambda: units_selector.get_children()[3], Eventually(Not(Is(None)))) | ||
199 | 60 | imperial_option = units_selector.get_children()[3] | 62 | imperial_option = units_selector.get_children()[3] |
200 | 61 | self.assertThat(lambda: imperial_option, Eventually(NotEquals(None))) | ||
201 | 62 | self.pointing_device.click_object(imperial_option) | 63 | self.pointing_device.click_object(imperial_option) |
202 | 63 | self.assertThat(units_selector.selectedIndex, Eventually(Equals(1))) | 64 | self.assertThat(units_selector.selectedIndex, Eventually(Equals(1))) |
203 | 64 | self._click_sheet_confirm() | 65 | self._click_sheet_confirm() |
204 | @@ -70,16 +71,16 @@ | |||
205 | 70 | 71 | ||
206 | 71 | # switch back to metric values again | 72 | # switch back to metric values again |
207 | 72 | self._open_settings_sheet() | 73 | self._open_settings_sheet() |
208 | 74 | self.assertThat(lambda: self.main_window.get_object('ValueSelector', 'UnitsSelector'), Eventually(Not(Is(None)))) | ||
209 | 73 | units_selector = self.main_window.get_object('ValueSelector', "UnitsSelector") | 75 | units_selector = self.main_window.get_object('ValueSelector', "UnitsSelector") |
210 | 74 | self.assertThat(lambda: units_selector, Eventually(NotEquals(None))) | ||
211 | 75 | self.assertThat(units_selector.selectedIndex, Eventually(Equals(1))) | 76 | self.assertThat(units_selector.selectedIndex, Eventually(Equals(1))) |
212 | 76 | self.pointing_device.click_object(units_selector) | 77 | self.pointing_device.click_object(units_selector) |
213 | 77 | self.assertThat(units_selector.expanded, Eventually(Equals(True))) | 78 | self.assertThat(units_selector.expanded, Eventually(Equals(True))) |
214 | 78 | 79 | ||
215 | 79 | # click celsius option | 80 | # click celsius option |
216 | 80 | self._move_pointer_around() | 81 | self._move_pointer_around() |
217 | 82 | self.assertThat(lambda: units_selector.get_children()[4], Eventually(Not(Is(None)))) | ||
218 | 81 | metric_option = units_selector.get_children()[4] | 83 | metric_option = units_selector.get_children()[4] |
219 | 82 | self.assertThat(lambda: metric_option, Eventually(NotEquals(None))) | ||
220 | 83 | self.pointing_device.click_object(metric_option) | 84 | self.pointing_device.click_object(metric_option) |
221 | 84 | 85 | ||
222 | 85 | # confirm | 86 | # confirm |
223 | @@ -97,15 +98,15 @@ | |||
224 | 97 | self._check_units('metric') | 98 | self._check_units('metric') |
225 | 98 | self._open_settings_sheet() | 99 | self._open_settings_sheet() |
226 | 99 | 100 | ||
227 | 101 | self.assertThat(lambda: self.main_window.get_object('ValueSelector', 'UnitsSelector'), Eventually(Not(Is(None)))) | ||
228 | 100 | units_selector = self.main_window.get_object('ValueSelector', "UnitsSelector") | 102 | units_selector = self.main_window.get_object('ValueSelector', "UnitsSelector") |
229 | 101 | self.assertThat(lambda: units_selector, Eventually(NotEquals(None))) | ||
230 | 102 | self.assertThat(units_selector.selectedIndex, Eventually(Equals(0))) | 103 | self.assertThat(units_selector.selectedIndex, Eventually(Equals(0))) |
231 | 103 | self.pointing_device.click_object(units_selector) | 104 | self.pointing_device.click_object(units_selector) |
232 | 104 | 105 | ||
233 | 105 | # choose second option, fahrenheit | 106 | # choose second option, fahrenheit |
234 | 106 | self._move_pointer_around() | 107 | self._move_pointer_around() |
235 | 108 | self.assertThat(lambda: units_selector.get_children()[3], Eventually(Not(Is(None)))) | ||
236 | 107 | imperial_option = units_selector.get_children()[3] | 109 | imperial_option = units_selector.get_children()[3] |
237 | 108 | self.assertThat(lambda: imperial_option, Eventually(NotEquals(None))) | ||
238 | 109 | self.pointing_device.click_object(imperial_option) | 110 | self.pointing_device.click_object(imperial_option) |
239 | 110 | self.assertThat(units_selector.selectedIndex, Eventually(Equals(1))) | 111 | self.assertThat(units_selector.selectedIndex, Eventually(Equals(1))) |
240 | 111 | 112 |
PASSED: Continuous integration, rev:94 91.189. 93.70:8080/ job/ubuntu- weather- app-ci/ 35/ 91.189. 93.70:8080/ job/ubuntu- weather- app-precise- amd64-ci/ 27 91.189. 93.70:8080/ job/ubuntu- weather- app-quantal- amd64-ci/ 34 91.189. 93.70:8080/ job/ubuntu- weather- app-raring- amd64-ci/ 34 91.189. 93.70:8080/ job/ubuntu- weather- app-saucy- amd64-ci/ 27
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- weather- app-ci/ 35/rebuild
http://