Merge ~jugmac00/launchpad:update-webservice-api-for-iperson.createppa into launchpad:master

Proposed by Jürgen Gmach
Status: Merged
Approved by: Jürgen Gmach
Approved revision: 8770cbe1d0505fa012a4b29bc04cc6f084b187b8
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~jugmac00/launchpad:update-webservice-api-for-iperson.createppa
Merge into: launchpad:master
Diff against target: 52 lines (+19/-1)
2 files modified
lib/lp/registry/interfaces/person.py (+1/-1)
lib/lp/soyuz/tests/test_person_createppa.py (+18/-0)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+409991@code.launchpad.net

Commit message

Update webservice API for IPerson.createPPA

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

Looks great, thanks. Could you just link this to the relevant bug before landing it?

review: Approve
Revision history for this message
Jürgen Gmach (jugmac00) wrote :

> Looks great, thanks. Could you just link this to the relevant bug before
> landing it?

Thanks for the review!

I just searched on Launchpad and https://bugs.launchpad.net/launchpad/+bug/868047 should be the relevant bug for it.

I also included a reference to the bug on Launchpad in the Jira issue.

Revision history for this message
Colin Watson (cjwatson) wrote :

Ah, I hadn't realized it wasn't already linked from Jira. LGTM, thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/lib/lp/registry/interfaces/person.py b/lib/lp/registry/interfaces/person.py
index febfb57..3610054 100644
--- a/lib/lp/registry/interfaces/person.py
+++ b/lib/lp/registry/interfaces/person.py
@@ -1742,7 +1742,7 @@ class IPersonEditRestricted(Interface):
1742 distribution=Reference(schema=Interface, required=False),1742 distribution=Reference(schema=Interface, required=False),
1743 name=TextLine(required=True, constraint=name_validator),1743 name=TextLine(required=True, constraint=name_validator),
1744 displayname=TextLine(required=False),1744 displayname=TextLine(required=False),
1745 description=TextLine(required=False),1745 description=Text(required=False),
1746 private=Bool(required=False),1746 private=Bool(required=False),
1747 suppress_subscription_notifications=Bool(required=False),1747 suppress_subscription_notifications=Bool(required=False),
1748 )1748 )
diff --git a/lib/lp/soyuz/tests/test_person_createppa.py b/lib/lp/soyuz/tests/test_person_createppa.py
index d3d9aff..cc0a00b 100644
--- a/lib/lp/soyuz/tests/test_person_createppa.py
+++ b/lib/lp/soyuz/tests/test_person_createppa.py
@@ -11,12 +11,15 @@ from lp.registry.enums import (
11 )11 )
12from lp.registry.errors import PPACreationError12from lp.registry.errors import PPACreationError
13from lp.registry.interfaces.teammembership import TeamMembershipStatus13from lp.registry.interfaces.teammembership import TeamMembershipStatus
14from lp.services.webapp.interfaces import OAuthPermission
14from lp.testing import (15from lp.testing import (
16 api_url,
15 celebrity_logged_in,17 celebrity_logged_in,
16 person_logged_in,18 person_logged_in,
17 TestCaseWithFactory,19 TestCaseWithFactory,
18 )20 )
19from lp.testing.layers import DatabaseFunctionalLayer21from lp.testing.layers import DatabaseFunctionalLayer
22from lp.testing.pages import webservice_for_person
2023
2124
22class TestCreatePPA(TestCaseWithFactory):25class TestCreatePPA(TestCaseWithFactory):
@@ -68,3 +71,18 @@ class TestCreatePPA(TestCaseWithFactory):
68 ppa = private_team.createPPA(private=True)71 ppa = private_team.createPPA(private=True)
69 self.assertEqual(True, ppa.private)72 self.assertEqual(True, ppa.private)
70 self.assertEqual(20480, ppa.authorized_size)73 self.assertEqual(20480, ppa.authorized_size)
74
75 def test_webservice_accepts_multiline_description(self):
76 user = self.factory.makePerson()
77 endpoint = api_url(user)
78 webservice = webservice_for_person(
79 user,
80 permission=OAuthPermission.WRITE_PUBLIC,
81 default_api_version='devel'
82 )
83
84 response = webservice.named_post(
85 endpoint, 'createPPA', description='a\nb'
86 )
87
88 self.assertEqual(201, response.status)

Subscribers

People subscribed via source and target branches

to status/vote changes: