Merge lp:~schwann/camera-app/camera-focus-opacity-eventually into lp:camera-app

Proposed by Günter Schwann
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 183
Merged at revision: 183
Proposed branch: lp:~schwann/camera-app/camera-focus-opacity-eventually
Merge into: lp:camera-app
Diff against target: 57 lines (+6/-6)
1 file modified
tests/autopilot/camera_app/tests/test_focus.py (+6/-6)
To merge this branch: bzr merge lp:~schwann/camera-app/camera-focus-opacity-eventually
Reviewer Review Type Date Requested Status
Olivier Tilloy Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+177765@code.launchpad.net

Commit message

Use Eventually for testing the focus ring opacity for 0.0

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/camera_app/tests/test_focus.py", line 44, in test_focus_valid_and_disappear
    self.assertEquals(focus_ring.opacity, Eventually(0.0))
  File "/usr/lib/python2.7/dist-packages/autopilot/matchers/__init__.py", line 95, in __init__
    "Eventually must be called with a testtools matcher argument.")
TypeError: Eventually must be called with a testtools matcher argument.

9 + self.assertEquals(focus_ring.opacity, Eventually(0.0))

should be:

    self.assertEquals(focus_ring.opacity, Eventually(Equals(0.0)))

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
183. By Günter Schwann

Fix autopilot

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

Looks good now.
Note that grepping through the code, I’m seeing that assertEquals(…) is stil used in various places, it might make sense to consider using assertThat(…) in conjunction with Eventually(Equals(…)) there too.

$ grep -rn assertEquals *
tests/autopilot/camera_app/tests/test_focus.py:54: self.assertEquals(focus_ring_center, click_coords)
tests/autopilot/camera_app/tests/test_focus.py:73: self.assertEquals(focus_ring_center, click_coords)
tests/autopilot/camera_app/tests/test_focus.py:142: self.assertEquals(focus_ring_center, center_click_coords)
tests/autopilot/camera_app/tests/test_focus.py:163: self.assertEquals(focus_ring_center, center_click_coords)
tests/autopilot/camera_app/tests/test_capture.py:65: self.assertEquals(one_picture_on_disk, True)
tests/autopilot/camera_app/tests/test_capture.py:94: self.assertEquals(stop_watch.elapsed, "00:00")
tests/autopilot/camera_app/tests/test_capture.py:122: self.assertEquals(stop_watch.elapsed, "00:00")
tests/autopilot/camera_app/tests/test_capture.py:145: self.assertEquals(exposure_button.enabled, True)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/camera_app/tests/test_focus.py'
2--- tests/autopilot/camera_app/tests/test_focus.py 2013-05-29 11:53:51 +0000
3+++ tests/autopilot/camera_app/tests/test_focus.py 2013-07-31 15:58:47 +0000
4@@ -41,7 +41,7 @@
5 exposure_button = self.main_window.get_exposure_button()
6
7 # The focus ring should be invisible in the beginning
8- self.assertEquals(focus_ring.opacity, 0.0)
9+ self.assertThat(focus_ring.opacity, Eventually(Equals(0.0)))
10
11 self.pointing_device.move_to_object(feed)
12 self.pointing_device.click()
13@@ -87,7 +87,7 @@
14 exposure_button = self.main_window.get_exposure_button()
15
16 # The focus ring should be invisible in the beginning
17- self.assertEquals(focus_ring.opacity, 0.0)
18+ self.assertThat(focus_ring.opacity, Eventually(Equals(0.0)))
19
20 x, y, h, w = toolbar.globalRect
21 tx = x + (h / 2)
22@@ -96,7 +96,7 @@
23 # focus there.
24 self.pointing_device.move(tx, ty)
25 self.pointing_device.click()
26- self.assertEquals(focus_ring.opacity, 0.0)
27+ self.assertThat(focus_ring.opacity, Eventually(Equals(0.0)))
28
29 # Check if there's a gap between the viewfinder feed and the zoom
30 # control. If there is, test that focusing there won't show the focus
31@@ -106,7 +106,7 @@
32 click_coords = [x + (h / 2), y - 2]
33 self.pointing_device.move(click_coords[0], click_coords[1])
34 self.pointing_device.click()
35- self.assertEquals(focus_ring.opacity, 0.0)
36+ self.assertThat(focus_ring.opacity, Eventually(Equals(0.0)))
37
38 # Switch cameras, wait for camera to settle, and try again
39 self.pointing_device.move_to_object(switch_cameras)
40@@ -119,7 +119,7 @@
41 click_coords = [x + (h / 2), y - 2]
42 self.pointing_device.move(click_coords[0], click_coords[1])
43 self.pointing_device.click()
44- self.assertEquals(focus_ring.opacity, 0.0)
45+ self.assertThat(focus_ring.opacity, Eventually(Equals(0.0)))
46
47 """Tests dragging the focus ring"""
48 def test_move_focus_ring(self):
49@@ -130,7 +130,7 @@
50 exposure_button = self.main_window.get_exposure_button()
51
52 # The focus ring should be invisible in the beginning
53- self.assertEquals(focus_ring.opacity, 0.0)
54+ self.assertThat(focus_ring.opacity, Eventually(Equals(0.0)))
55
56 # Focus to the center of the viewfinder feed
57 self.pointing_device.move_to_object(feed)

Subscribers

People subscribed via source and target branches