Merge ~cjwatson/launchpad:use-getUniqueUnicode into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 67b8a5ac78232d26033d676d82729b0ac431557c
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:use-getUniqueUnicode
Merge into: launchpad:master
Diff against target: 40 lines (+4/-4)
1 file modified
lib/lp/testing/factory.py (+4/-4)
Reviewer Review Type Date Requested Status
Thiago F. Pappacena (community) Approve
Review via email: mp+386919@code.launchpad.net

Commit message

Use getUniqueUnicode() rather than getUniqueString().decode()

Description of the change

This makes Python 3 porting easier, because the intent is clearer.

To post a comment you must log in.
Revision history for this message
Thiago F. Pappacena (pappacena) wrote :

LGTM

review: Approve
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/testing/factory.py b/lib/lp/testing/factory.py
2index 87ca1bc..1a6d4ec 100644
3--- a/lib/lp/testing/factory.py
4+++ b/lib/lp/testing/factory.py
5@@ -1785,7 +1785,7 @@ class BareLaunchpadObjectFactory(ObjectFactory):
6 if owner is None:
7 owner = self.makePerson()
8 if name is None:
9- name = self.getUniqueString('gitrepository').decode('utf-8')
10+ name = self.getUniqueUnicode('gitrepository')
11
12 if target is _DEFAULT:
13 target = self.makeProduct()
14@@ -1824,7 +1824,7 @@ class BareLaunchpadObjectFactory(ObjectFactory):
15 if repository is None:
16 repository = self.makeGitRepository(**repository_kwargs)
17 if paths is None:
18- paths = [self.getUniqueString('refs/heads/path').decode('utf-8')]
19+ paths = [self.getUniqueUnicode('refs/heads/path')]
20 refs_info = {
21 path: {
22 u"sha1": unicode(
23@@ -1843,7 +1843,7 @@ class BareLaunchpadObjectFactory(ObjectFactory):
24 if repository_url is None:
25 repository_url = self.getUniqueURL()
26 if path is None:
27- path = self.getUniqueString('refs/heads/path').decode('utf-8')
28+ path = self.getUniqueUnicode('refs/heads/path')
29 return getUtility(IGitRefRemoteSet).new(repository_url, path)
30
31 def makeGitRule(self, repository=None, ref_pattern=u"refs/heads/*",
32@@ -3081,7 +3081,7 @@ class BareLaunchpadObjectFactory(ObjectFactory):
33 distroseries = self.makeSourcePackageRecipeDistroseries()
34
35 if name is None:
36- name = self.getUniqueString('spr-name').decode('utf8')
37+ name = self.getUniqueUnicode('spr-name')
38 if description is None:
39 description = self.getUniqueString(
40 'spr-description').decode('utf8')

Subscribers

People subscribed via source and target branches

to status/vote changes: