Merge lp:~thomir-deactivatedaccount/autopilot/fix-warnings into lp:autopilot

Proposed by Thomi Richards
Status: Merged
Approved by: Martin Pitt
Approved revision: 332
Merged at revision: 331
Proposed branch: lp:~thomir-deactivatedaccount/autopilot/fix-warnings
Merge into: lp:autopilot
Diff against target: 54 lines (+20/-1)
2 files modified
autopilot/introspection/__init__.py (+5/-1)
autopilot/tests/functional/test_introspection_features.py (+15/-0)
To merge this branch: bzr merge lp:~thomir-deactivatedaccount/autopilot/fix-warnings
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Martin Pitt (community) Approve
Review via email: mp+186639@code.launchpad.net

Commit message

Remove a spurious log message.

Description of the change

Remove a spurious log message.

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

LGTM.

review: Approve
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)
332. By Thomi Richards

Move test to be a functional test, since it needs dbus.

Revision history for this message
Martin Pitt (pitti) wrote :

Same story as for the 1.3 branch, LGTM.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'autopilot/introspection/__init__.py'
2--- autopilot/introspection/__init__.py 2013-09-18 17:17:08 +0000
3+++ autopilot/introspection/__init__.py 2013-09-20 14:32:14 +0000
4@@ -404,7 +404,11 @@
5
6 def _connection_matches_pid(bus, connection_name, pid):
7 """Given a PID checks wherever it or its children are connected on this
8- bus."""
9+ bus.
10+
11+ """
12+ if connection_name == 'org.freedesktop.DBus':
13+ return False
14 try:
15 if _bus_pid_is_our_pid(bus, connection_name, pid):
16 return False
17
18=== modified file 'autopilot/tests/functional/test_introspection_features.py'
19--- autopilot/tests/functional/test_introspection_features.py 2013-09-08 17:25:37 +0000
20+++ autopilot/tests/functional/test_introspection_features.py 2013-09-20 14:32:14 +0000
21@@ -17,7 +17,9 @@
22 # along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #
24
25+from dbus import SessionBus
26 import json
27+from mock import patch
28 import os
29 import subprocess
30 import tempfile
31@@ -28,6 +30,7 @@
32 from autopilot.matchers import Eventually
33 from autopilot.testcase import AutopilotTestCase
34 from autopilot.introspection.dbus import CustomEmulatorBase
35+from autopilot.introspection import _connection_matches_pid
36
37
38 class EmulatorBase(CustomEmulatorBase):
39@@ -123,3 +126,15 @@
40 self.assertThat(result1.wasSuccessful(), Equals(True))
41 result2 = InnerTestCase('test_custom_emulator').run()
42 self.assertThat(result2.wasSuccessful(), Equals(True))
43+
44+
45+class IntrospectionFunctionTests(AutopilotTestCase):
46+
47+ @patch('autopilot.introspection._connection_matches_pid')
48+ @patch('autopilot.introspection._bus_pid_is_our_pid')
49+ def test_connection_matches_pid_ignores_dbus_daemon(
50+ self, bus_pid_is_our_pid, conn_matches_pid_fn):
51+ _connection_matches_pid(SessionBus(), 'org.freedesktop.DBus', 123)
52+
53+ self.assertThat(bus_pid_is_our_pid.called, Equals(False))
54+ self.assertThat(conn_matches_pid_fn.called, Equals(False))

Subscribers

People subscribed via source and target branches