on xenial help sign in
ExpectFailure for bluetooth indicator under wily
048cdaaMichał Sawicz
tests/autopilot/unity8/indicators/tests/test_indicators.py+10−13
@@ -16,9 +16,11 @@
16# You should have received a copy of the GNU General Public License
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18
18
19+import platform
20+
19from testscenarios import multiply_scenarios
21from testscenarios import multiply_scenarios
20
22
21−from autopilot import platform
23+import autopilot.platform
22
24
23from unity8.indicators import tests
25from unity8.indicators import tests
24
26
@@ -39,12 +41,6 @@ class IndicatorExistsTestCase(tests.DeviceIndicatorTestCase):
39 tests.IndicatorTestCase.device_emulation_scenarios
41 tests.IndicatorTestCase.device_emulation_scenarios
40 )
42 )
41
43
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−
48 def test_indicator_exists(self):
44 def test_indicator_exists(self):
49 self.main_window._get_indicator_panel_item(
45 self.main_window._get_indicator_panel_item(
50 self.indicator_name
46 self.indicator_name
@@ -74,12 +70,6 @@ class IndicatorPageTitleMatchesWidgetTestCase(tests.DeviceIndicatorTestCase):
74 tests.IndicatorTestCase.device_emulation_scenarios
70 tests.IndicatorTestCase.device_emulation_scenarios
75 )
71 )
76
72
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−
83 def test_indicator_page_title_matches_widget(self):
73 def test_indicator_page_title_matches_widget(self):
84 """Swiping open an indicator must show its correct title.
74 """Swiping open an indicator must show its correct title.
85
75
@@ -87,5 +77,12 @@ class IndicatorPageTitleMatchesWidgetTestCase(tests.DeviceIndicatorTestCase):
87 """
77 """
88 indicator_page = self.main_window.open_indicator_page(
78 indicator_page = self.main_window.open_indicator_page(
89 self.indicator_name)
79 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)
90 self.assertTrue(indicator_page.visible)
87 self.assertTrue(indicator_page.visible)
91 self.assertEqual(indicator_page.title, self.title)
88 self.assertEqual(indicator_page.title, self.title)