on xenial help sign in
Skip bluetooth check under wily, use expectFailure to notice when it's back

Approved by: Albert Astals Cid

commit637b1462b64df6af9995a1e28c76c810fa191838 authorMichał Sawicz <michal.sawicz@canonical.com> dateFri 25 Sep 2015, 12:13 (11 years ago) parent6b19988854e59e
1 file changed+10−13
tests/autopilot/unity8/indicators/tests/test_indicators.py+10−13
tests/autopilot/unity8/indicators/tests/test_indicators.py+10−13
@@ -16,9 +16,11 @@
1616# You should have received a copy of the GNU General Public License
1717# along with this program. If not, see <http://www.gnu.org/licenses/>.
1818
19+import platform
20+
1921from testscenarios import multiply_scenarios
2022
21−from autopilot import platform
23+import autopilot.platform
2224
2325from unity8.indicators import tests
2426
@@ -39,12 +41,6 @@ class IndicatorExistsTestCase(tests.DeviceIndicatorTestCase):
3941 tests.IndicatorTestCase.device_emulation_scenarios
4042 )
4143
42− def setUp(self):
43− super().setUp()
44− if (platform.model() == 'Nexus 10' and
45− self.indicator_name == 'indicator-bluetooth'):
46− self.skipTest('Nexus 10 does not have bluetooth at the moment.')
47−
4844 def test_indicator_exists(self):
4945 self.main_window._get_indicator_panel_item(
5046 self.indicator_name
@@ -74,12 +70,6 @@ class IndicatorPageTitleMatchesWidgetTestCase(tests.DeviceIndicatorTestCase):
7470 tests.IndicatorTestCase.device_emulation_scenarios
7571 )
7672
77− def setUp(self):
78− super().setUp()
79− if (platform.model() == 'Nexus 10' and
80− self.indicator_name == 'indicator-bluetooth'):
81− self.skipTest('Nexus 10 does not have bluetooth at the moment.')
82−
8373 def test_indicator_page_title_matches_widget(self):
8474 """Swiping open an indicator must show its correct title.
8575
@@ -87,5 +77,12 @@ class IndicatorPageTitleMatchesWidgetTestCase(tests.DeviceIndicatorTestCase):
8777 """
8878 indicator_page = self.main_window.open_indicator_page(
8979 self.indicator_name)
80+ if self.indicator_name == 'indicator-bluetooth':
81+ if autopilot.platform.model() == 'Nexus 10':
82+ self.expectFailure('Nexus 10 does not have bluetooth at the moment.',
83+ self.assertTrue, indicator_page.visible)
84+ if platform.linux_distribution()[2] == 'wily':
85+ self.expectFailure('Bluetooth doesn\'t work on wily at the moment.',
86+ self.assertTrue, indicator_page.visible)
9087 self.assertTrue(indicator_page.visible)
9188 self.assertEqual(indicator_page.title, self.title)