on xenial help sign in
Implemented suggested style fixes, removed assertIsNotNone.
commit39a420ef2fec7e6db56690579957ab99a2398b81 authorAllan LeSage <allan.lesage@canonical.com> dateFri 6 Dec 2013, 10:48 (13 years ago) parentd551766
2 files changed+7−10
tests/autopilot/unity8/indicators/emulators/widget.py+7−7 tests/autopilot/unity8/indicators/tests/test_indicators.py−3
tests/autopilot/unity8/indicators/emulators/widget.py+7−7
@@ -1,7 +1,7 @@
11# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
22#
3−# Unity Autopilot Test Suite
4−# Copyright (C) 2012-2013 Canonical
3+# Unity Indicators Autopilot Test Suite
4+# Copyright (C) 2013 Canonical
55#
66# This program is free software: you can redistribute it and/or modify
77# it under the terms of the GNU General Public License as published by
@@ -29,12 +29,12 @@ class DefaultIndicatorWidget(UnityEmulatorBase):
2929 super(DefaultIndicatorWidget, self).__init__(*args, **kwargs)
3030 self.pointer = Pointer(Touch.create())
3131
32− # TODO: submit to autopilot.introspection.types.Rectangle
32+ # TODO: submit to autopilot.introspection.types.Rectangle [alesage 2013-12-06]
3333 def get_center(self):
3434 """Returns (x, y) representing the center of a globalRect."""
3535 return (
36− self.globalRect[0]+int(self.globalRect[2]/2),
37− self.globalRect[1]+int(self.globalRect[3]/2)
36+ self.globalRect.x+int(self.globalRect.width/2),
37+ self.globalRect.y+int(self.globalRect.height/2)
3838 )
3939
4040 def swipe_to_open_indicator(self, window):
@@ -46,7 +46,7 @@ class DefaultIndicatorWidget(UnityEmulatorBase):
4646 start_x, start_y,
4747 end_x, end_y
4848 )
49− # TODO: assert that the indicator page opened
49+ # TODO: assert that the indicator page opened [alesage 2013-12-06]
5050
5151 def swipe_to_close_indicator(self, window):
5252 """Swipe to close the indicator, wait until it's closed."""
@@ -57,4 +57,4 @@ class DefaultIndicatorWidget(UnityEmulatorBase):
5757 start_x, start_y,
5858 end_x, end_y
5959 )
60− # TODO: assert that the indicator page closed
60+ # TODO: assert that the indicator page closed [alesage 2013-12-06]
tests/autopilot/unity8/indicators/tests/test_indicators.py−3
@@ -15,7 +15,6 @@
1515#
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/>.
18−#
1918
2019from __future__ import absolute_import
2120
@@ -50,7 +49,6 @@ class IndicatorTestCase(UnityTestCase):
5049 widget = self.main_window.get_indicator_widget(
5150 self.indicator_name
5251 )
53− self.assertIsNotNone(widget)
5452
5553
5654class IndicatorPageTitleMatchesWidgetTestCase(UnityTestCase):
@@ -86,7 +84,6 @@ class IndicatorPageTitleMatchesWidgetTestCase(UnityTestCase):
8684 unlock_unity(unity_proxy)
8785 window = self.main_window.get_qml_view()
8886 widget = self.main_window.get_indicator_widget(self.indicator_name)
89− self.assertIsNotNone(widget)
9087 widget.swipe_to_open_indicator(window)
9188 title = window.wait_select_single(
9289 "IndicatorPage",