Merge lp:~phablet-team/camera-app/fix-failing-tests into lp:camera-app

Proposed by Ugo Riboni on 2015-02-17
Status: Merged
Approved by: Bill Filler on 2015-02-17
Approved revision: 513
Merged at revision: 512
Proposed branch: lp:~phablet-team/camera-app/fix-failing-tests
Merge into: lp:camera-app
Diff against target: 84 lines (+29/-23)
2 files modified
tests/autopilot/camera_app/tests/test_flash.py (+23/-21)
tests/autopilot/camera_app/tests/test_gallery_view.py (+6/-2)
To merge this branch: bzr merge lp:~phablet-team/camera-app/fix-failing-tests
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing on 2015-02-17
Ubuntu Phablet Team 2015-02-17 Pending
Review via email: mp+250054@code.launchpad.net

Commit Message

Fix some failing tests (that were failing for real test bugs, not due to infrastructure problems).

Description of the Change

Fix some failing tests (that were failing for real test bugs, not due to infrastructure problems)

To post a comment you must log in.

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_flash.py'
2--- tests/autopilot/camera_app/tests/test_flash.py 2014-12-17 16:29:11 +0000
3+++ tests/autopilot/camera_app/tests/test_flash.py 2015-02-17 19:00:33 +0000
4@@ -28,35 +28,37 @@
5 def tearDown(self):
6 super(TestCameraFlash, self).tearDown()
7
8- """Test that flash modes cycle properly"""
9+ """Test that flash modes activate properly"""
10 def test_cycle_flash(self):
11 bottom_edge = self.main_window.get_bottom_edge()
12 bottom_edge.open()
13 flash_button = self.main_window.get_flash_button()
14 option_value_selector = self.main_window.get_option_value_selector()
15
16- # ensure initial state
17+ # open option value selector showing the possible values
18+ self.pointing_device.move_to_object(flash_button)
19+ self.pointing_device.click()
20+ self.assertThat(option_value_selector.visible,
21+ Eventually(Equals(True)))
22+
23+ # set flash to "on"
24+ option = self.main_window.get_option_value_button("On")
25+ self.pointing_device.move_to_object(option)
26+ self.pointing_device.click()
27+ self.assertThat(flash_button.iconName, Equals("flash-on"))
28+
29+ # set flash to "off"
30+ option = self.main_window.get_option_value_button("Off")
31+ self.pointing_device.move_to_object(option)
32+ self.pointing_device.click()
33+ self.assertThat(flash_button.iconName, Equals("flash-off"))
34+
35+ # set flash to "auto"
36+ option = self.main_window.get_option_value_button("Auto")
37+ self.pointing_device.move_to_object(option)
38+ self.pointing_device.click()
39 self.assertThat(flash_button.iconName, Equals("flash-auto"))
40
41- # open option value selector showing the possible values
42- self.pointing_device.move_to_object(flash_button)
43- self.pointing_device.click()
44-
45- self.assertThat(option_value_selector.visible,
46- Eventually(Equals(True)))
47-
48- # set flash to "on"
49- option = self.main_window.get_option_value_button("On")
50-
51- self.pointing_device.click()
52- self.assertThat(flash_button.iconName, Equals("flash-on"))
53-
54- # set flash to "off"
55- option = self.main_window.get_option_value_button("Off")
56- self.pointing_device.move_to_object(option)
57- self.pointing_device.click()
58- self.assertThat(flash_button.iconName, Equals("flash-off"))
59-
60 """Test that video flash modes cycles properly"""
61 def test_cycle_video_flash(self):
62 # Click the record button to toggle photo/video mode
63
64=== modified file 'tests/autopilot/camera_app/tests/test_gallery_view.py'
65--- tests/autopilot/camera_app/tests/test_gallery_view.py 2015-01-24 18:49:15 +0000
66+++ tests/autopilot/camera_app/tests/test_gallery_view.py 2015-02-17 19:00:33 +0000
67@@ -55,11 +55,15 @@
68 def delete_all_media(self):
69 picture_files = os.listdir(self.pictures_dir)
70 for f in picture_files:
71- os.remove(os.path.join(self.pictures_dir, f))
72+ f = os.path.join(self.pictures_dir, f)
73+ if os.path.isfile(f):
74+ os.remove(f)
75
76 video_files = os.listdir(self.videos_dir)
77 for f in video_files:
78- os.remove(os.path.join(self.videos_dir, f))
79+ f = os.path.join(self.videos_dir, f)
80+ if os.path.isfile(f):
81+ os.remove(f)
82
83 def add_sample_photo(self):
84 self.main_window.swipe_to_viewfinder(self)

Subscribers

People subscribed via source and target branches