Merge lp:~nskaggs/autopilot/fix-state-verbiage into lp:autopilot

Proposed by Nicholas Skaggs
Status: Merged
Approved by: Thomi Richards
Approved revision: 439
Merged at revision: 447
Proposed branch: lp:~nskaggs/autopilot/fix-state-verbiage
Merge into: lp:autopilot
Diff against target: 74 lines (+11/-11)
2 files modified
autopilot/introspection/dbus.py (+3/-3)
autopilot/tests/unit/test_exceptions.py (+8/-8)
To merge this branch: bzr merge lp:~nskaggs/autopilot/fix-state-verbiage
Reviewer Review Type Date Requested Status
Thomi Richards (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+207543@code.launchpad.net

Commit message

Fix the veribage for statenotfound errors, fixes https://bugs.launchpad.net/autopilot/+bug/1269649

Description of the change

Fix the veribage for statenotfound errors

To post a comment you must log in.
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)
439. By Nicholas Skaggs

rebase to trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

LGTM - test failures are due to new trusty packages, and will be fixed in a separate MP.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'autopilot/introspection/dbus.py'
--- autopilot/introspection/dbus.py 2013-11-07 21:27:55 +0000
+++ autopilot/introspection/dbus.py 2014-02-25 22:20:40 +0000
@@ -77,16 +77,16 @@
7777
78 if class_name is None:78 if class_name is None:
79 self._message = \79 self._message = \
80 u"State not found with filters {}.".format(80 u"Object not found with properties {}.".format(
81 repr(filters)81 repr(filters)
82 )82 )
83 elif not filters:83 elif not filters:
84 self._message = u"State not found for class '{}'.".format(84 self._message = u"Object not found with name '{}'.".format(
85 class_name85 class_name
86 )86 )
87 else:87 else:
88 self._message = \88 self._message = \
89 u"State not found for class '{}' and filters {}.".format(89 u"Object not found with name '{}' and properties {}.".format(
90 class_name,90 class_name,
91 repr(filters)91 repr(filters)
92 )92 )
9393
=== modified file 'autopilot/tests/unit/test_exceptions.py'
--- autopilot/tests/unit/test_exceptions.py 2013-10-13 21:49:49 +0000
+++ autopilot/tests/unit/test_exceptions.py 2014-02-25 22:20:40 +0000
@@ -41,12 +41,12 @@
41 err = StateNotFoundError("MyClass")41 err = StateNotFoundError("MyClass")
42 self.assertThat(42 self.assertThat(
43 str(err),43 str(err),
44 Equals("State not found for class 'MyClass'.")44 Equals("Object not found with name 'MyClass'.")
45 )45 )
46 if not six.PY3:46 if not six.PY3:
47 self.assertThat(47 self.assertThat(
48 unicode(err),48 unicode(err),
49 Equals(u"State not found for class 'MyClass'.")49 Equals(u"Object not found with name 'MyClass'.")
50 )50 )
5151
52 def test_can_be_constructed_with_filters_only(self):52 def test_can_be_constructed_with_filters_only(self):
@@ -54,12 +54,12 @@
54 err = StateNotFoundError(foo="bar")54 err = StateNotFoundError(foo="bar")
55 self.assertThat(55 self.assertThat(
56 str(err),56 str(err),
57 Equals("State not found with filters {'foo': 'bar'}.")57 Equals("Object not found with properties {'foo': 'bar'}.")
58 )58 )
59 if not six.PY3:59 if not six.PY3:
60 self.assertThat(60 self.assertThat(
61 unicode(err),61 unicode(err),
62 Equals(u"State not found with filters {'foo': 'bar'}.")62 Equals(u"Object not found with properties {'foo': 'bar'}.")
63 )63 )
6464
65 def test_can_be_constructed_with_class_name_and_filters(self):65 def test_can_be_constructed_with_class_name_and_filters(self):
@@ -67,12 +67,12 @@
67 err = StateNotFoundError('MyClass', foo="bar")67 err = StateNotFoundError('MyClass', foo="bar")
68 self.assertThat(68 self.assertThat(
69 str(err),69 str(err),
70 Equals("State not found for class 'MyClass'"70 Equals("Object not found with name 'MyClass'"
71 " and filters {'foo': 'bar'}.")71 " and properties {'foo': 'bar'}.")
72 )72 )
73 if not six.PY3:73 if not six.PY3:
74 self.assertThat(74 self.assertThat(
75 unicode(err),75 unicode(err),
76 Equals(u"State not found for class 'MyClass'"76 Equals(u"Object not found with name 'MyClass'"
77 " and filters {'foo': 'bar'}.")77 " and properties {'foo': 'bar'}.")
78 )78 )

Subscribers

People subscribed via source and target branches