Merge lp:~mwhudson/launchpad/no-project-in-ui-bug-409655 into lp:launchpad

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~mwhudson/launchpad/no-project-in-ui-bug-409655
Merge into: lp:launchpad
Diff against target: 51 lines (+11/-2)
2 files modified
lib/canonical/launchpad/xmlrpc/faults.py (+8/-1)
lib/lp/code/xmlrpc/tests/test_branch.py (+3/-1)
To merge this branch: bzr merge lp:~mwhudson/launchpad/no-project-in-ui-bug-409655
Reviewer Review Type Date Requested Status
Tim Penhey (community) Approve
Review via email: mp+19828@code.launchpad.net

Commit message

Don't refer to 'project' in error message for say lp:mysql when we mean 'project group'

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/canonical/launchpad/xmlrpc/faults.py'
--- lib/canonical/launchpad/xmlrpc/faults.py 2009-11-12 06:28:08 +0000
+++ lib/canonical/launchpad/xmlrpc/faults.py 2010-02-21 22:18:18 +0000
@@ -44,6 +44,9 @@
44import xmlrpclib44import xmlrpclib
4545
4646
47from lp.registry.interfaces.projectgroup import IProjectGroup
48
49
47def check_fault(fault, *fault_classes):50def check_fault(fault, *fault_classes):
48 """Check if 'fault's faultCode matches any of 'fault_classes'.51 """Check if 'fault's faultCode matches any of 'fault_classes'.
4952
@@ -312,9 +315,13 @@
312 "%(component_type)s cannot have a default branch.")315 "%(component_type)s cannot have a default branch.")
313316
314 def __init__(self, component):317 def __init__(self, component):
318 if IProjectGroup.providedBy(component):
319 component_type = 'project group'
320 else:
321 component_type = component.__class__.__name__.lower()
315 LaunchpadFault.__init__(322 LaunchpadFault.__init__(
316 self, component_name=component.displayname,323 self, component_name=component.displayname,
317 component_type=component.__class__.__name__.lower())324 component_type=component_type)
318325
319326
320class InvalidProductIdentifier(LaunchpadFault):327class InvalidProductIdentifier(LaunchpadFault):
321328
=== modified file 'lib/lp/code/xmlrpc/tests/test_branch.py'
--- lib/lp/code/xmlrpc/tests/test_branch.py 2009-11-12 04:28:28 +0000
+++ lib/lp/code/xmlrpc/tests/test_branch.py 2010-02-21 22:18:18 +0000
@@ -73,6 +73,7 @@
73 % (lp_url_path, fault))73 % (lp_url_path, fault))
74 self.assertEqual(expected_fault.__class__, fault.__class__)74 self.assertEqual(expected_fault.__class__, fault.__class__)
75 self.assertEqual(expected_fault.faultString, fault.faultString)75 self.assertEqual(expected_fault.faultString, fault.faultString)
76 return fault
7677
77 def test_resultDict(self):78 def test_resultDict(self):
78 # A given lp url path maps to a single branch available from a number79 # A given lp url path maps to a single branch available from a number
@@ -121,8 +122,9 @@
121 # Resolving lp:///project_group_name' should explain that project122 # Resolving lp:///project_group_name' should explain that project
122 # groups don't have default branches.123 # groups don't have default branches.
123 project_group = self.factory.makeProject()124 project_group = self.factory.makeProject()
124 self.assertFault(125 fault = self.assertFault(
125 project_group.name, faults.CannotHaveLinkedBranch(project_group))126 project_group.name, faults.CannotHaveLinkedBranch(project_group))
127 self.assertIn('project group', fault.faultString)
126128
127 def test_distro_name(self):129 def test_distro_name(self):
128 # Resolving lp:///distro_name' should explain that distributions don't130 # Resolving lp:///distro_name' should explain that distributions don't