on xenial help sign in
Stylistic cleanups.
commit996643d6f15b53562e647cebc7f8268ecca0e667 authorAllan LeSage <allan.lesage@canonical.com> dateTue 3 Dec 2013, 19:57 (13 years ago) parentae2c02f
3 files changed+19−11
tests/autopilot/unity8/indicators/emulators/__init__.py+1−1 tests/autopilot/unity8/indicators/emulators/widget.py+12−6 tests/autopilot/unity8/indicators/tests/test_indicators.py+6−4
tests/autopilot/unity8/indicators/emulators/__init__.py+1−1
@@ -1,7 +1,7 @@
11# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
22#
33# Unity Indicators Autopilot Test Suite
4−# Copyright (C) 2012-2013 Canonical
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
tests/autopilot/unity8/indicators/emulators/widget.py+12−6
@@ -32,16 +32,20 @@ class DefaultIndicatorWidget(UnityEmulatorBase):
3232 # TODO: submit to autopilot.introspection.types.Rectangle
3333 def get_center(self):
3434 """Returns (x, y) representing the center of a globalRect."""
35− return (self.globalRect[0]+int(self.globalRect[2]/2),
36− self.globalRect[1]+int(self.globalRect[3]/2))
35+ return (
36+ self.globalRect[0]+int(self.globalRect[2]/2),
37+ self.globalRect[1]+int(self.globalRect[3]/2)
38+ )
3739
3840 def swipe_to_open_indicator(self, window):
3941 """Swipe to open the indicator, wait until it's open."""
4042 start_x, start_y = self.get_center()
4143 end_x = start_x
4244 end_y = window.height
43− self.pointer.drag(start_x, start_y,
44− end_x, end_y)
45+ self.pointer.drag(
46+ start_x, start_y,
47+ end_x, end_y
48+ )
4549 # TODO: assert that the indicator page opened
4650
4751 def swipe_to_close_indicator(self, window):
@@ -49,6 +53,8 @@ class DefaultIndicatorWidget(UnityEmulatorBase):
4953 end_x, end_y = self.get_center()
5054 start_x = end_x
5155 start_y = window.height
52− self.pointer.drag(start_x, start_y,
53− end_x, end_y)
56+ self.pointer.drag(
57+ start_x, start_y,
58+ end_x, end_y
59+ )
5460 # TODO: assert that the indicator page closed
tests/autopilot/unity8/indicators/tests/test_indicators.py+6−4
@@ -19,7 +19,7 @@
1919
2020from __future__ import absolute_import
2121
22−from autopilot.platform import model
22+import autopilot.platform
2323
2424from unity8.indicators.emulators.widget import DefaultIndicatorWidget
2525from unity8.process_helpers import unlock_unity
@@ -73,7 +73,7 @@ class IndicatorPageTitleMatchesWidgetTestCase(UnityTestCase):
7373 ]
7474
7575 def setUp(self):
76− if model() == "Desktop":
76+ if platform.model() == "Desktop":
7777 self.skipTest("Test cannot be run on the desktop.")
7878 super(IndicatorPageTitleMatchesWidgetTestCase, self).setUp()
7979
@@ -88,5 +88,7 @@ class IndicatorPageTitleMatchesWidgetTestCase(UnityTestCase):
8888 widget = self.main_window.get_indicator_widget(self.indicator_name)
8989 self.assertIsNotNone(widget)
9090 widget.swipe_to_open_indicator(window)
91− title = window.wait_select_single("IndicatorPage",
92− title=self.title)
91+ title = window.wait_select_single(
92+ "IndicatorPage",
93+ title=self.title
94+ )