Merge lp:~canonical-platform-qa/autopilot/fix-zesty-build into lp:autopilot

Proposed by Richard Huddie
Status: Merged
Approved by: Santiago Baldassin
Approved revision: 596
Merged at revision: 594
Proposed branch: lp:~canonical-platform-qa/autopilot/fix-zesty-build
Merge into: lp:autopilot
Diff against target: 87 lines (+14/-7)
1 file modified
autopilot/tests/unit/test_application_launcher.py (+14/-7)
To merge this branch: bzr merge lp:~canonical-platform-qa/autopilot/fix-zesty-build
Reviewer Review Type Date Requested Status
Santiago Baldassin (community) Approve
platform-qa-bot continuous-integration Approve
Review via email: mp+321891@code.launchpad.net

Commit message

Fix zesty package building.

Description of the change

Use a mocked UbuntuAppLaunch during unit tests to stop the reported errors during self tests in package building on zesty.

To post a comment you must log in.
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ɓukasz Zemczak (sil2100) wrote :

Excellent! I see it makes the trunk buildable again - could we get it reviewed and merged? I could then follow up with my dep-change. Would have to release both then though to the archive...

Revision history for this message
Richard Huddie (rhuddie) wrote :

> Excellent! I see it makes the trunk buildable again - could we get it reviewed
> and merged? I could then follow up with my dep-change. Would have to release
> both then though to the archive...

I'm just waiting to get someone to review it. Should be fine as its only unit test update. We'll do a combined release of this plus the dep removal mp.

Revision history for this message
Santiago Baldassin (sbaldassin) wrote :

Code looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'autopilot/tests/unit/test_application_launcher.py'
2--- autopilot/tests/unit/test_application_launcher.py 2017-03-01 23:11:40 +0000
3+++ autopilot/tests/unit/test_application_launcher.py 2017-04-04 18:50:39 +0000
4@@ -631,9 +631,10 @@
5 loop = UpstartApplicationLauncher._get_glib_loop()
6 self.assertThat(loop, IsInstance(GLib.MainLoop))
7
8+ @patch('autopilot.application._launcher.UbuntuAppLaunch')
9 @patch('autopilot.application._launcher.'
10 'get_proxy_object_for_existing_process')
11- def test_handle_string(self, _):
12+ def test_handle_string(self, gpofep, ual):
13 launcher = UpstartApplicationLauncher()
14 token_a = self.getUniqueString()
15 token_b = self.getUniqueString()
16@@ -643,9 +644,10 @@
17 launcher.launch(token_a, token_b)
18 la.assert_called_once_with(token_a, [token_b])
19
20+ @patch('autopilot.application._launcher.UbuntuAppLaunch')
21 @patch('autopilot.application._launcher.'
22 'get_proxy_object_for_existing_process')
23- def test_handle_bytes(self, _):
24+ def test_handle_bytes(self, gpofep, ual):
25 launcher = UpstartApplicationLauncher()
26 token_a = self.getUniqueString()
27 token_b = self.getUniqueString()
28@@ -655,9 +657,10 @@
29 launcher.launch(token_a, token_b.encode())
30 la.assert_called_once_with(token_a, [token_b])
31
32+ @patch('autopilot.application._launcher.UbuntuAppLaunch')
33 @patch('autopilot.application._launcher.'
34 'get_proxy_object_for_existing_process')
35- def test_handle_list(self, _):
36+ def test_handle_list(self, gpofep, ual):
37 launcher = UpstartApplicationLauncher()
38 token_a = self.getUniqueString()
39 token_b = self.getUniqueString()
40@@ -667,9 +670,10 @@
41 launcher.launch(token_a, [token_b])
42 la.assert_called_once_with(token_a, [token_b])
43
44+ @patch('autopilot.application._launcher.UbuntuAppLaunch')
45 @patch('autopilot.application._launcher.'
46 'get_proxy_object_for_existing_process')
47- def test_calls_get_pid(self, _):
48+ def test_calls_get_pid(self, gpofep, ual):
49 launcher = UpstartApplicationLauncher()
50 token = self.getUniqueString()
51 with patch.object(launcher, '_launch_app'):
52@@ -678,9 +682,10 @@
53 launcher.launch(token)
54 gp.assert_called_once_with(token)
55
56+ @patch('autopilot.application._launcher.UbuntuAppLaunch')
57 @patch('autopilot.application._launcher.'
58 'get_proxy_object_for_existing_process')
59- def test_gets_correct_proxy_object(self, gpofep):
60+ def test_gets_correct_proxy_object(self, gpofep, ual):
61 launcher = UpstartApplicationLauncher()
62 with patch.object(launcher, '_launch_app'):
63 with patch.object(launcher, '_get_pid_for_launched_app') as gp:
64@@ -690,9 +695,10 @@
65 emulator_base=None,
66 dbus_bus='session')
67
68+ @patch('autopilot.application._launcher.UbuntuAppLaunch')
69 @patch('autopilot.application._launcher.'
70 'get_proxy_object_for_existing_process')
71- def test_returns_proxy_object(self, gpofep):
72+ def test_returns_proxy_object(self, gpofep, ual):
73 launcher = UpstartApplicationLauncher()
74 with patch.object(launcher, '_launch_app'):
75 with patch.object(launcher, '_get_pid_for_launched_app'):
76@@ -700,9 +706,10 @@
77 result = launcher.launch('')
78 self.assertEqual(result, gpofep.return_value)
79
80+ @patch('autopilot.application._launcher.UbuntuAppLaunch')
81 @patch('autopilot.application._launcher.'
82 'get_proxy_object_for_existing_process')
83- def test_calls_get_glib_loop(self, gpofep):
84+ def test_calls_get_glib_loop(self, gpofep, ual):
85 launcher = UpstartApplicationLauncher()
86 with patch.object(launcher, '_launch_app'):
87 with patch.object(launcher, '_get_pid_for_launched_app'):

Subscribers

People subscribed via source and target branches