Merge lp:~nskaggs/dropping-letters/fix-pep8 into lp:dropping-letters

Proposed by Nicholas Skaggs
Status: Merged
Approved by: Nicholas Skaggs
Approved revision: 40
Merged at revision: 40
Proposed branch: lp:~nskaggs/dropping-letters/fix-pep8
Merge into: lp:dropping-letters
Diff against target: 110 lines (+20/-12)
2 files modified
tests/autopilot/dropping_letters_app/tests/__init__.py (+6/-3)
tests/autopilot/dropping_letters_app/tests/test_dropping_letters.py (+14/-9)
To merge this branch: bzr merge lp:~nskaggs/dropping-letters/fix-pep8
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Dropping Letters developers Pending
Review via email: mp+188109@code.launchpad.net

Commit message

Cleanup and fix pep8 issues in tests

Description of the change

Cleanup and fix pep8 issues in tests

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
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/dropping_letters_app/tests/__init__.py'
2--- tests/autopilot/dropping_letters_app/tests/__init__.py 2013-09-26 18:03:39 +0000
3+++ tests/autopilot/dropping_letters_app/tests/__init__.py 2013-09-27 16:59:32 +0000
4@@ -38,13 +38,14 @@
5 scenarios = [('with touch', dict(input_device_class=Touch))]
6
7 local_location = "../../dropping-letters.qml"
8+ installed_location = "/usr/share/dropping-letters/dropping-letters.qml"
9
10 def setUp(self):
11 self.pointing_device = Pointer(self.input_device_class.create())
12 super(DroppingLettersTestCase, self).setUp()
13 if os.path.exists(self.local_location):
14 self.launch_test_local()
15- elif os.path.exists('/usr/share/dropping-letters/dropping-letters.qml'):
16+ elif os.path.exists(self.installed_location):
17 self.launch_test_installed()
18 else:
19 self.launch_test_click()
20@@ -59,14 +60,16 @@
21 def launch_test_installed(self):
22 self.app = self.launch_test_application(
23 "qmlscene",
24- "/usr/share/dropping-letters/dropping-letters.qml",
25+ self.installed_location,
26 "--desktop_file_hint=/usr/share/applications/"
27 "dropping-letters.desktop",
28 app_type='qt',
29 emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)
30
31 def launch_test_click(self):
32- self.app = self.launch_click_package('com.ubuntu.dropping-letters', emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)
33+ self.app = self.launch_click_package(
34+ "com.ubuntu.dropping-letters",
35+ emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)
36
37 @property
38 def main_view(self):
39
40=== modified file 'tests/autopilot/dropping_letters_app/tests/test_dropping_letters.py'
41--- tests/autopilot/dropping_letters_app/tests/test_dropping_letters.py 2013-09-26 19:02:31 +0000
42+++ tests/autopilot/dropping_letters_app/tests/test_dropping_letters.py 2013-09-27 16:59:32 +0000
43@@ -45,14 +45,16 @@
44 self.pointing_device.click_object(helpbutton)
45
46 #check and ensure help popover appears
47- self.assertThat(self.main_view.get_help_popover, Eventually(NotEquals(None)))
48+ self.assertThat(self.main_view.get_help_popover,
49+ Eventually(NotEquals(None)))
50 helpPopover = self.main_view.get_help_popover()
51 properties = helpPopover.get_properties()
52 self.assertTrue(properties["visible"])
53
54 #check and ensure help popover disappears
55 self.pointing_device.click_object(helpbutton)
56- self.assertThat(self.main_view.get_help_popover, Eventually(Equals(None)))
57+ self.assertThat(self.main_view.get_help_popover,
58+ Eventually(Equals(None)))
59
60 def test_start_new_game(self):
61 toolbar = self.main_view.open_toolbar()
62@@ -69,18 +71,20 @@
63 toolbar = self.main_view.close_toolbar()
64
65 #check for letters falling
66- #select first 2 letters; wait for 3 letters to appear so first 2 are settled for clicking
67+ #select first 2 letters; wait for 3 letters to appear
68+ #so first 2 are settled for clicking
69 tiles = self.main_view.get_letter_tiles()
70 while len(tiles) < 3:
71 tiles = self.main_view.get_letter_tiles()
72
73 #click the accumlated letters
74 #check and make sure they get selected
75- #add tries as a control to avoid infinite loop and provide better failure feedback
76+ #add tries as a control to avoid infinite loop
77+ #and provide better failure feedback
78 tries = 0
79 self.pointing_device.click_object(tiles[0])
80 tileProperties = tiles[0].get_properties()
81- while (tileProperties["selected"] == False and tries < 10):
82+ while (not tileProperties["selected"] and tries < 10):
83 sleep(1)
84 tries += 1
85 self.pointing_device.click_object(tiles[0])
86@@ -91,7 +95,7 @@
87 tries = 0
88 self.pointing_device.click_object(tiles[1])
89 tileProperties = tiles[1].get_properties()
90- while (tileProperties["selected"] == False and tries < 10):
91+ while (not tileProperties["selected"] and tries < 10):
92 sleep(1)
93 tries += 1
94 self.pointing_device.click_object(tiles[1])
95@@ -108,11 +112,12 @@
96 validWord = word.isValid
97 self.pointing_device.click_object(word)
98
99- #depending on if the property isValid is true or not, score should increase or stay the same after completion
100- #we don't need to get fancy, since the start value is 0; check for zero or non-zero score
101+ #depending on if the property isValid is true or not,
102+ #score should increase or stay the same after completion
103+ #we don't need to get fancy, since the start value is 0;
104+ #check for zero or non-zero score
105 main_score_label = self.main_view.get_main_score_label()
106 if validWord:
107 self.assertNotEquals(main_score_label.text, '0')
108 else:
109 self.assertEquals(main_score_label.text, '0')
110-

Subscribers

People subscribed via source and target branches